svc.sh: switch linked/link to enabled/enable

This commit is contained in:
mollusk 2020-02-16 19:33:01 -07:00
parent 68ee6fc236
commit 3ab3961c0e

24
svc.sh
View File

@ -35,19 +35,19 @@ help(){
printf """
svc - Service Commander - frontend for the sv command
Usage: svc link | unlink | linked | list | up | start | restart | stop <service>
Usage: svc enable | unenable | enableed | list | up | start | restart | stop <service>
For detailed help, see the commands below:
start Start a linked service
restart Restart a linked service
stop Stop a linked service
link Symlink directory/file to /var/service
unlink Remove symlink from
linked View symlink paths of all services
ls List linked and unlinked service files
start Start an enabled service
restart Restart a enabled service
stop Stop an enabled service
enable Symenlink directory/file to /var/service
unenable Remove symlink from /var/service
enabled View synlinked paths of all services
ls List enabled and unenabled service files
up Show status of running services
"""
@ -55,15 +55,15 @@ up Show status of running services
case $1 in
link | --link-service )
enable | --enable-service )
ln -v -s /etc/sv/"${2}" /var/service/
;;
unlink | --remove-service )
unenable | --remove-service )
rm -v /var/service/"${2}"
;;
linked | --linked-services )
enabled | --enabled-services )
cd /etc/sv && find -xtype l -exec ls -l {} \;
;;
@ -73,7 +73,7 @@ case $1 in
echo -e "${LGREEN}Available Services (/etc/sv/):${NC}\n"
ls /etc/sv
echo
echo -e "${LCYAN}Running Services (/var/service):${NC}\n"
echo -e "${LCYAN}Enabled Services (/var/service):${NC}\n"
echo
ls /var/service
echo