3 Commits

Author SHA1 Message Date
406eb2cca6 Minor fix 2024-01-02 20:02:34 +01:00
d240dbcb39 If current sessions SVDIR is not available, enable/disable the services in the default runlevel 2024-01-02 01:13:35 +01:00
6959074db1 Update help info 2022-12-26 19:39:22 +01:00

27
rsm
View File

@@ -12,8 +12,9 @@
# Date: August 29, 2018
# License: MIT
RSM_VERSION='v1.4.6'
RSM_VERSION='v1.4.9'
export RUNSVDIR=${RUNSVDIR:-/etc/runit/runsvdir}
export SVDIR=${SVDIR:-/run/runit/service/}
export LOGDIR="/var/log/"
export RSVDIR="/run/runit/service/"
@@ -127,13 +128,14 @@ usage() {
cat <<EOF
$colormagenta ______ ____ __ __
$colormagenta | | \ \ / ___\ | \/ | $colorgreen Runit Service Manager for Artix Linux ($RSM_VERSION)
$colormagenta | |_/ / \____ | || | $colorgreen Source: https://gitea.artixlinux.org/linuxer/Runit-Service-Manager
$colormagenta | |_/ / \____ | || | $colorgreen Source: https://gitea.artixlinux.org/nikolar/Runit-Service-Manager
$colormagenta | | \ \ \____/ | || | $colorgreen MIT License
$logo $colorblue Manage and view runit services
$logo $colorblue Made specifically for Void Linux but should work anywhere
$logo $colorblue Author: Dave Eddy <dave@daveeddy.com> (bahamas10)
$logo $colorblue Forked specifically for Artix Linux and renamed to rsm, for further development
$logo $colorblue Maitained by nikolar <nikolar@artixlinux.org> (nikolar in #artix)
${coloryellow}USAGE:${colorgreen}
$progname [OPTIONS] [SUBCOMMAND] [<ARGS>]
@@ -480,7 +482,12 @@ do_enable_disable() {
rmsg 1 "failed to enable '$svc'"
ret=1
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
fi
;;
@@ -490,7 +497,12 @@ do_enable_disable() {
rmsg 1 "failed to disable '$svc'"
ret=1
else
unlink ${SVDIR}${svc}
if [ -L "${SVDIR}" ]
then
unlink "${SVDIR}${svc}"
else
unlink "${RUNSVDIR}/default/${svc}" # default runlevel
fi
do_status
fi
;;
@@ -653,7 +665,12 @@ if ((do_usage > -1)); then
fi
# 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
if [[ -z $cmd ]]; then