Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
f4e12ec2e1
|
|||
533d0e6250
|
@@ -1,5 +1,4 @@
|
||||
# `rsm` - Runit Service Manager
|
||||
===================================
|
||||
|
||||
- This is the CLI Runit Service Manager {rsm}, forked from Void Service Manager {vsv} https://github.com/bahamas10/vsv/blob/master/vsv
|
||||
|
||||
@@ -18,7 +17,7 @@ Quick Examples:
|
||||
- `rsm status` - same as above
|
||||
- `rsm stop <svc>` - stop a service
|
||||
- `rsm start <svc>` - start a service
|
||||
- `rsm restart <svc>` - restart a service
|
||||
- `rsm restart <svc>` - restart a service, or start service right after `rsm enable <svc>`
|
||||
- `rsm enable <svc>` - enable a service (autostart at boot)
|
||||
- `rsm disable <svc>` - disable a service (no autostart at boot)
|
||||
- `rsm hup <svc>` - refresh a service (`SIGHUP`)
|
||||
|
16
rsm
16
rsm
@@ -1,14 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Void Linux service manager (runit)
|
||||
# Artix Linux service manager (runit)
|
||||
# Forked and further developed, by: linuxer <linuxer@artixlinux.org>
|
||||
#
|
||||
# Author: Dave Eddy <dave@daveeddy.com>
|
||||
# Original Author (vsv): Dave Eddy <dave@daveeddy.com>
|
||||
# Date: August 29, 2018
|
||||
# License: MIT
|
||||
|
||||
RSM_VERSION='v1.3.7'
|
||||
RSM_VERSION='v1.3.8'
|
||||
|
||||
export SVDIR=${SVDIR:-/run/runit/service/}
|
||||
export FLDIR=${FLDIR:-/etc/runit/sv/}
|
||||
|
||||
|
||||
charup='✔'
|
||||
chardown='X'
|
||||
@@ -123,6 +126,7 @@ $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
|
||||
|
||||
${coloryellow}USAGE:${colorgreen}
|
||||
$progname [OPTIONS] [SUBCOMMAND] [<ARGS>]
|
||||
@@ -449,7 +453,7 @@ do_enable_disable() {
|
||||
fi
|
||||
|
||||
# ensure service exists
|
||||
if ! [[ -d $svc ]]; then
|
||||
if ! [[ -d ${FLDIR}${svc} ]]; then
|
||||
rmsg -1 "service directory '$svc' does not exist" >&2
|
||||
continue
|
||||
fi
|
||||
@@ -462,6 +466,8 @@ do_enable_disable() {
|
||||
if ! rm -f "$file"; then
|
||||
rmsg 1 "failed to enable '$svc'"
|
||||
ret=1
|
||||
else
|
||||
ln -s ${FLDIR}${svc} ${SVDIR}
|
||||
fi
|
||||
;;
|
||||
disable)
|
||||
@@ -469,6 +475,8 @@ do_enable_disable() {
|
||||
if ! disable_message "$svc" > "$file"; then
|
||||
rmsg 1 "failed to disable '$svc'"
|
||||
ret=1
|
||||
else
|
||||
unlink ${SVDIR}$svc
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
Reference in New Issue
Block a user