Compare commits
3 commits
219e75adea
...
7c0ebf50b5
Author | SHA1 | Date | |
---|---|---|---|
7c0ebf50b5 | |||
71cf6b99a3 | |||
8c82f35f31 |
1 changed files with 16 additions and 4 deletions
|
@ -3,6 +3,17 @@ perror() {
|
||||||
>&2 printf '\033[1;31mERROR:\033[0m \033[1m%s\033[0m\n' "$*"
|
>&2 printf '\033[1;31mERROR:\033[0m \033[1m%s\033[0m\n' "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
name=$(basename "$0")
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
${name}: usage
|
||||||
|
${name} [status] - show if the server is running
|
||||||
|
${name} start|stop|restart - control the server
|
||||||
|
${name} help|usage - show help
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
error_usage() {
|
error_usage() {
|
||||||
perror "invalid usage"
|
perror "invalid usage"
|
||||||
>&2 usage
|
>&2 usage
|
||||||
|
@ -46,13 +57,14 @@ status() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
""|status) status ;;
|
""|stat*) status ;;
|
||||||
start) start ;;
|
star*) start ;;
|
||||||
stop) stop ;;
|
sto*) stop ;;
|
||||||
restart)
|
r*)
|
||||||
stop
|
stop
|
||||||
start
|
start
|
||||||
;;
|
;;
|
||||||
|
h*|u*) usage ;;
|
||||||
*)
|
*)
|
||||||
error_usage
|
error_usage
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue