| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/syno/sbin/ |
Upload File : |
#!/usr/bin/env bash
# Copyright (c) 2019 Synology Inc. All rights reserved.
SYNOSYSTEMCTL="/usr/syno/bin/synosystemctl"
SERVICE_NAME="atalk"
usage() {
local H="[1m"
local E="[0m"
cat <<EOF
Usage: $(basename "$0") <actions>
Actions:
$H --check_status$E get service active status
$H --health$E service is disable or okay: 0, something is error: 1, others: 2
$H -h, --help$E show this help message
EOF
}
syslog() {
logger -p user.err -t "$(basename "$0")[$$]" "$@"
}
service_is_enabled() {
[[ "enabled" = $(${SYNOSYSTEMCTL} get-enable-status ${SERVICE_NAME}) ]]
}
service_status() {
${SYNOSYSTEMCTL} get-active-status ${SERVICE_NAME}
}
service_health() {
if ! service_is_enabled; then
return 0
fi
local status="$(service_status)"
case "${status,,}" in
"active")
return 0
;;
"failed")
syslog "service in failed status"
return 1
;;
*)
syslog "skip service status: $status"
return 2
;;
esac
}
case $1 in
--check_status)
service_status
;;
--health)
service_health
exit $?
;;
-h|--help)
usage "$@"
;;
*)
usage "$@" >&2
exit "${LSB_ERR_ARGS:-2}"
;;
esac