Skip to content
Snippets Groups Projects
Commit ff80fad3 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

zmena exit statusu pro testu spustitelnosti; zmena nazvu funkci

parent 23e3eebe
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ LOCK_FILE="/var/lock/warden-server"
SCRIPTNAME=`basename "$0"`
# check if daemon is present and executable
test -x $DAEMON || exit 1
test -x $DAEMON || exit 0
if [ $UID -ne 0 ]; then
echo "You must be root for runnnig this script!"
......@@ -63,7 +63,8 @@ usage() {
}
check_status() {
if /bin/ps axo pid,comm | grep -q "warden-server*"; then
/bin/ps axo pid,comm | grep -q "warden-server*"; RET_VAL=`echo $?`
if [ $RET_VAL -eq 0 ]; then
STATUS=1 # true - warden is running
else
STATUS=0 # false - warden is not running
......@@ -75,7 +76,7 @@ get_pid() {
return $PID
}
start() {
warden_start() {
check_status
if [ $STATUS -eq 1 ]; then
get_pid PID
......@@ -89,7 +90,7 @@ start() {
fi
}
stop() {
warden_stop() {
check_status
if [ $STATUS -eq 1 ]; then
logger -s "Stopping Warden server daemon ..."
......@@ -106,7 +107,7 @@ stop() {
fi
}
status() {
warden_status() {
check_status
if [ $STATUS -eq 1 ]; then
get_pid PID
......@@ -118,7 +119,7 @@ status() {
fi
}
force_stop() {
warden_force_stop() {
check_status
if [ $STATUS -eq 1 ]; then
logger -s "Force stopping Warden server daemon ..."
......@@ -135,16 +136,16 @@ force_stop() {
case $1 in
status)
status
warden_status
;;
start)
start
warden_start
;;
stop)
stop
warden_stop
;;
force-stop)
force_stop
warden_force_stop
;;
restart)
$0 stop
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment