GHP publish
This commit is contained in:
25
ddclient/root/etc/cont-init.d/30-config
Normal file
25
ddclient/root/etc/cont-init.d/30-config
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# make our folders
|
||||
mkdir -p \
|
||||
/var/cache/ddclient \
|
||||
/var/run/ddclient
|
||||
|
||||
# copy default config if not present in /config
|
||||
[[ ! -e /config/ddclient.conf ]] && \
|
||||
cp /defaults/ddclient.conf /config
|
||||
|
||||
# copy config from /config to root
|
||||
cp /config/ddclient.conf /ddclient.conf
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc \
|
||||
/config \
|
||||
/var/cache/ddclient \
|
||||
/var/run/ddclient \
|
||||
/ddclient.conf
|
||||
|
||||
chmod 700 /config
|
||||
chmod 600 \
|
||||
/config/* \
|
||||
/ddclient.conf
|
3
ddclient/root/etc/services.d/ddclient/run
Normal file
3
ddclient/root/etc/services.d/ddclient/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
exec \
|
||||
s6-setuidgid abc /usr/bin/ddclient -foreground -file /ddclient.conf
|
10
ddclient/root/etc/services.d/inotify_modify/run
Normal file
10
ddclient/root/etc/services.d/inotify_modify/run
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# starting inotify to watch /config/ddclient.conf and restart ddclient if changed.
|
||||
while inotifywait -e modify /config/ddclient.conf; do
|
||||
cp /config/ddclient.conf /ddclient.conf
|
||||
chown abc:abc /ddclient.conf
|
||||
chmod 600 /ddclient.conf
|
||||
s6-svc -h /var/run/s6/services/ddclient
|
||||
echo "ddclient has been restarted"
|
||||
done
|
Reference in New Issue
Block a user