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

26
svc.sh
View File

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