mirror of
https://github.com/linuxserver/docker-mods.git
synced 2026-03-23 00:05:28 +08:00
switch to hybrid
This commit is contained in:
parent
05c92c2b1e
commit
60d4ea1368
8
root/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-add-package/run
Executable file
8
root/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-add-package/run
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ ! -f /usr/sbin/cron ] && [ -f /usr/bin/apt ]; then
|
||||
echo "**** Adding cron to package install list ****"
|
||||
echo "cron" >> /mod-repo-packages-to-install.list
|
||||
else
|
||||
echo "**** cron package already installed, skipping ****"
|
||||
fi
|
||||
@ -0,0 +1 @@
|
||||
oneshot
|
||||
@ -0,0 +1 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-add-package/run
|
||||
33
root/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-setup/run
Executable file
33
root/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-setup/run
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# make folders
|
||||
mkdir -p \
|
||||
/config/crontabs
|
||||
|
||||
# if root crontabs do not exist in config
|
||||
# copy root crontab from system
|
||||
if [[ ! -f /config/crontabs/root ]] && \
|
||||
crontab -l -u root; then
|
||||
crontab -l -u root > /config/crontabs/root
|
||||
fi
|
||||
|
||||
# if root crontabs still do not exist in config (were not copied from system)
|
||||
# copy root crontab from included defaults
|
||||
[[ ! -f /config/crontabs/root ]] && \
|
||||
cp /defaults/crontabs-mod/root /config/crontabs/
|
||||
|
||||
# if abc crontabs do not exist in config
|
||||
# copy abc crontab from system
|
||||
if [[ ! -f /config/crontabs/abc ]] && \
|
||||
crontab -l -u abc; then
|
||||
crontab -l -u abc > /config/crontabs/abc
|
||||
fi
|
||||
|
||||
# if abc crontabs still do not exist in config (were not copied from system)
|
||||
# copy abc crontab from included defaults
|
||||
[[ ! -f /config/crontabs/abc ]] && \
|
||||
cp /defaults/crontabs-mod/abc /config/crontabs/
|
||||
|
||||
# import user crontabs
|
||||
crontab -u root /config/crontabs/root
|
||||
crontab -u abc /config/crontabs/abc
|
||||
@ -0,0 +1 @@
|
||||
oneshot
|
||||
@ -0,0 +1 @@
|
||||
/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-setup/run
|
||||
9
root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/run
Executable file
9
root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/run
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ -f /usr/bin/apt ]; then
|
||||
# ubuntu
|
||||
exec /usr/sbin/cron -f -L 1
|
||||
elif [ -f /sbin/apk ]; then
|
||||
# alpine
|
||||
exec /usr/sbin/crond -f -S -l 5
|
||||
fi
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
0
root/etc/services.d/cron/run
Normal file → Executable file
0
root/etc/services.d/cron/run
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user