From ff811e2f45ccb45f225dbcfe414b328c34756993 Mon Sep 17 00:00:00 2001 From: mollusk Date: Sat, 30 Nov 2019 23:17:32 -0700 Subject: [PATCH] svc.sh: tidy help file --- svc.sh | 126 +++++++++++---------------------------------------------- 1 file changed, 24 insertions(+), 102 deletions(-) diff --git a/svc.sh b/svc.sh index 8743334..692146f 100755 --- a/svc.sh +++ b/svc.sh @@ -16,6 +16,7 @@ ## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ############################################################################################## + RED='\033[0;31m' LRED="\033[1;31m" BLUE="\033[0;34m" @@ -30,6 +31,28 @@ LPURPLE="\033[1;35m" BWHITE="\e[1m" NC='\033[0m' # No Color +help(){ +printf """ +svc - Service Commander - frontend for the sv command + +Usage: svc link | unlink | linked | list | up | start | restart | stop + + +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 +up Show status of running services + +""" +} + case $1 in link | --link-service ) @@ -73,107 +96,6 @@ case $1 in ;; --help | -h | help ) - echo - echo " sc - Service Commander - frontend for the sv command" - echo - echo " Usage: sc link | unlink | linked | list | up | start | restart | stop " - echo - echo - echo " For detailed help, see the commands below:" - echo - echo - echo " help-all" - echo " help-link" - echo " help-unlink" - echo " help-linked" - echo " help-list" - echo " help-up" - echo " help-start" - echo " help-restart" - echo " help-stop" - echo + help ;; - - help-link ) - echo - echo "link : Creates a symlink from /etc/sv/ -> /var/service/" - echo - ;; - - help-unlink ) - echo - echo "unlink : Removes symlink from /etc/sv/ -> /var/service/" - echo - ;; - - help-linked ) - echo - echo "linked : Lists all symlinked items in /etc/sv" - echo - ;; - - help-list ) - echo - echo "list : List the contents of /etc/sv and /var/service" - echo - ;; - - help-up ) - echo - echo "up : Lists all currently running services" - echo - ;; - - help-start ) - echo - echo "start : Uses the 'sv' command to start a service" - echo - ;; - - help-restart ) - echo - echo "restart : Uses the 'sv' command to restart a service" - echo - ;; - - help-stop ) - echo - echo "stop : Uses the 'sv' command to stop a service" - echo - ;; - - help-all ) - echo - echo "link : Creates a symlink from /etc/sv/ -> /var/service/" - echo "unlink : Removes symlink from /etc/sv/ -> /var/service/" - echo "linked : Lists all symlinked items in /etc/sv" - echo "list : List the contents of /etc/sv and /var/service" - echo "up : Lists all currently running services" - echo "start : Uses the 'sv' command to start a service" - echo "restart : Uses the 'sv' command to restart a service" - echo "stop : Uses the 'sv' command to stop a service" - echo - ;; - *) - echo - echo " svc - Service Commander - frontend for the sv command" - echo - echo " Usage: svc link | unlink | linked | list | up | start | restart | stop " - echo - echo - echo " For detailed help, see the commands below:" - echo - echo - echo " help-all" - echo " help-link" - echo " help-unlink" - echo " help-linked" - echo " help-list" - echo " help-up" - echo " help-start" - echo " help-restart" - echo " help-stop" - echo - - ;; esac