File: //etc/init/synotunnel.conf
description "Synology IPv6 tunnel service"
author "Storage Technology Team"
start on syno.network.ready
stop on runlevel [06]
console log
pre-start script
if [ "`get_key_value /etc.defaults/synoinfo.conf ipv4only`" = "yes" ]; then
stop; exit 0
fi
if [ -x /etc/gogoc/rc.tun ] && [ -x /usr/syno/bin/synotunnelexec ]; then
# When booting we don't want to block and delay ready-time of DSM if we
# failed to do successful connection. Therefore we put the script
# running in backgorund. However, when we are called from UI, we can't
# just pretend all is well when the connection is failed, or UI won't
# show the error messages.
if /usr/syno/bin/synobootseq --is-booting-up &> /dev/null; then
/usr/syno/bin/synotunnelexec start &
else
/usr/syno/bin/synotunnelexec start
fi
fi
end script
post-stop script
if [ -x /etc/gogoc/rc.tun ]; then
if [ -x /usr/syno/bin/synotunnelexec ]; then
/usr/syno/bin/synotunnelexec stop
fi
fi
end script