mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:00:43 +00:00
35 lines
593 B
Bash
Executable File
35 lines
593 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
args=("$@")
|
|
if [[ "${args[0]:-}" == "--user" ]]; then
|
|
args=("${args[@]:1}")
|
|
fi
|
|
cmd="${args[0]:-}"
|
|
|
|
case "$cmd" in
|
|
status) ;;
|
|
is-active)
|
|
echo "inactive" >&2
|
|
exit 3
|
|
;;
|
|
is-enabled)
|
|
unit="${args[1]:-}"
|
|
unit_path="$HOME/.config/systemd/user/${unit}"
|
|
if [ -f "$unit_path" ]; then
|
|
echo "enabled"
|
|
exit 0
|
|
fi
|
|
echo "disabled" >&2
|
|
exit 1
|
|
;;
|
|
show)
|
|
printf "%s\n" \
|
|
"ActiveState=inactive" \
|
|
"SubState=dead" \
|
|
"MainPID=0" \
|
|
"ExecMainStatus=0" \
|
|
"ExecMainCode=0"
|
|
;;
|
|
esac
|