Difference between revisions of "/opt/atlassian/jira/bin/stop-jira.sh"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<pre> \#!/bin/bash # resolve links - $0 may be a softlink - stolen from catalina.sh PRG="$0" while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'`...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
\#!/bin/bash
+
#!/bin/bash
  
 
# resolve links - $0 may be a softlink - stolen from catalina.sh
 
# resolve links - $0 may be a softlink - stolen from catalina.sh
Line 38: Line 38:
  
 
</pre>
 
</pre>
 +
 +
== Related terms ==
 +
* <code>[[/opt/atlassian/jira/bin/start-jira.sh]]</code>
 +
* <code>[[/var/atlassian/application-data/jira/log/atlassian-jira.log]]</code>
  
 
== See also ==
 
== See also ==

Latest revision as of 11:21, 11 March 2021

#!/bin/bash

# resolve links - $0 may be a softlink - stolen from catalina.sh
PRG="$0"
while [ -h "$PRG" ]; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done
PRGDIR=`dirname "$PRG"`

. `dirname $0`/user.sh #readin the username

if [ -z "$JIRA_USER" ] || [ $(id -un) == "$JIRA_USER" ]; then
    echo executing as current user

    exec $PRGDIR/shutdown.sh 20 -force $@

elif [ $UID -ne 0 ]; then

    echo Jira has been installed to run as $JIRA_USER so please sudo run this to enable switching to that user
    exit 1

else

    echo executing using dedicated user
    if [ -x "/sbin/runuser" ]; then
        sucmd="/sbin/runuser"
    else
        sucmd="su"
    fi
    $sucmd -m $JIRA_USER -c "$PRGDIR/shutdown.sh 20 -force $@"

Related terms[edit]

See also[edit]

Advertising: