forked from linuxer/Runit-Service-Manager
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 406eb2cca6 | |||
| d240dbcb39 |
24
rsm
24
rsm
@@ -12,8 +12,9 @@
|
|||||||
# Date: August 29, 2018
|
# Date: August 29, 2018
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
RSM_VERSION='v1.4.7'
|
RSM_VERSION='v1.4.9'
|
||||||
|
|
||||||
|
export RUNSVDIR=${RUNSVDIR:-/etc/runit/runsvdir}
|
||||||
export SVDIR=${SVDIR:-/run/runit/service/}
|
export SVDIR=${SVDIR:-/run/runit/service/}
|
||||||
export LOGDIR="/var/log/"
|
export LOGDIR="/var/log/"
|
||||||
export RSVDIR="/run/runit/service/"
|
export RSVDIR="/run/runit/service/"
|
||||||
@@ -481,7 +482,12 @@ do_enable_disable() {
|
|||||||
rmsg 1 "failed to enable '$svc'"
|
rmsg 1 "failed to enable '$svc'"
|
||||||
ret=1
|
ret=1
|
||||||
else
|
else
|
||||||
ln -s ${FLDIR}${svc} ${SVDIR}
|
if [ -L "${SVDIR}" ]
|
||||||
|
then
|
||||||
|
ln -s "${FLDIR}${svc}" "${SVDIR}"
|
||||||
|
else
|
||||||
|
ln -s "${FLDIR}${svc}" "${RUNSVDIR}/default" # default runlevel
|
||||||
|
fi
|
||||||
do_status
|
do_status
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -491,7 +497,12 @@ do_enable_disable() {
|
|||||||
rmsg 1 "failed to disable '$svc'"
|
rmsg 1 "failed to disable '$svc'"
|
||||||
ret=1
|
ret=1
|
||||||
else
|
else
|
||||||
unlink ${SVDIR}${svc}
|
if [ -L "${SVDIR}" ]
|
||||||
|
then
|
||||||
|
unlink "${SVDIR}${svc}"
|
||||||
|
else
|
||||||
|
unlink "${RUNSVDIR}/default/${svc}" # default runlevel
|
||||||
|
fi
|
||||||
do_status
|
do_status
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -654,7 +665,12 @@ if ((do_usage > -1)); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# move to the service directory
|
# move to the service directory
|
||||||
cd "$SVDIR" || fatal "failed to enter dir: $SVDIR"
|
if [ -L "$SVDIR" ]
|
||||||
|
then
|
||||||
|
cd "$SVDIR" || fatal "failed to enter dir: $SVDIR"
|
||||||
|
else
|
||||||
|
cd "$RUNSVDIR/default" || fatal "failed to enter dir: $FLDIR"
|
||||||
|
fi
|
||||||
|
|
||||||
# figure out 'cmd' command
|
# figure out 'cmd' command
|
||||||
if [[ -z $cmd ]]; then
|
if [[ -z $cmd ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user