Last active
June 27, 2020 16:24
-
-
Save dsh0005/bb3b2284df7b2c85436243e7df705dde to your computer and use it in GitHub Desktop.
ddns-route53 OpenRC init script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
command="/usr/local/bin/ddns-route53" | |
description="Route53 Dynamic DNS daemon" | |
cfgfile="/etc/ddns-route53/ddns-route53.yml" | |
schedule='\*/15\ \*\ \*\ \*\ \*' | |
command_args="--config \"${cfgfile}\" --schedule ${schedule}" | |
command_user="ddnsr53u:ddnsr53" | |
command_background=true | |
pidfile="/run/${RC_SVCNAME}.pid" | |
depend() { | |
need net | |
provide ddns | |
} | |
checkconfig() { | |
# basic sanity check only | |
if [ ! -f "${cfgfile}" ] ; then | |
eerror "Please create ddns-route53.yml" | |
return 1 | |
fi | |
return 0 | |
} | |
start_pre() { | |
if [ "${RC_CMD}" != "restart" ] ; then | |
checkconfig || return $? | |
fi | |
} | |
stop_pre() { | |
if [ "${RC_CMD}" = "restart" ] ; then | |
checkconfig || return $? | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lines 6-7 do the right thing, but for all the really wrong reasons.
Trace: