HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/etc.defaults/init/synorelay-service-handler.conf
author "Network Infrastructure Team"
description "watch service actions, check if synorelayd should add/remove conf when insterested service start/stop"

start on \
	syno.service.action SERVICE_NAME=ssh-shell or \
	syno.service.action SERVICE_NAME=telnetd or \
	syno.service.action SERVICE_NAME=nginx or \
	syno.service.action SERVICE_NAME=synorelayd or \
	syno.service.action SERVICE_NAME=support-remote-access


task
instance $SERVICE_NAME

export SERVICE_NAME
export SERVICE_ACTION

script
	# avoid reload twice
	if [ "x${SERVICE_NAME}" = "xsynorelayd" ] || [ "x${SERVICE_NAME}" = "xsupport-remote-access" ] ; then
		if [ "x${SERVICE_ACTION}" = "xreload" ]; then
			exit 0
		fi
	fi

	# reload synorelayd
	if /usr/syno/sbin/synoservice --status synorelayd > /dev/null 2>&1; then
		/usr/syno/sbin/synoservice --reload synorelayd || true
		exit 0
	fi

	# reload support channel
	if /usr/syno/sbin/synoservice --status support-remote-access > /dev/null 2>&1; then
		/usr/syno/sbin/synoservice --reload support-remote-access || true
		exit 0
	fi
end script

# vim:ft=upstart