first commit
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=common.sh
|
||||
source "$SCRIPT_DIR/common.sh"
|
||||
|
||||
action="${1:-status}"
|
||||
case "$action" in
|
||||
start|stop|restart)
|
||||
require_root
|
||||
systemctl "$action" "$SERVICE_NAME"
|
||||
;;
|
||||
status)
|
||||
systemctl --no-pager --full status "$SERVICE_NAME"
|
||||
;;
|
||||
logs)
|
||||
exec journalctl -u "$SERVICE_NAME" -f
|
||||
;;
|
||||
health)
|
||||
curl -fsS "$(health_url)"; printf '\n'
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status|logs|health}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user