File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,6 @@ if [ "$PUID" != "0" ] && [ "$PGID" != "0" ]; then
1717 # Ensure explo user owns the working directory and data directory
1818 chown -R explo:explo /opt/explo
1919 [ -d /data ] && chown -R explo:explo /data
20-
21- # If running as non-root, exec as the explo user
22- if [ " $( id -u) " = " 0" ]; then
23- exec su-exec explo " $0 " " $@ "
24- fi
2520fi
2621
2722echo " [setup] Initializing cron jobs..."
@@ -36,6 +31,7 @@ if [ "$PUID" != "0" ] && [ "$PGID" != "0" ]; then
3631 chown " $CRON_USER :$CRON_USER " " /var/spool/cron/crontabs/$CRON_USER "
3732fi
3833
34+ # If block for older versions of Explo ($CRON_SCHEDULE was deprecated in v0.11.0)
3935if [ -n " $CRON_SCHEDULE " ]; then
4036 cmd=" apk add --upgrade yt-dlp && cd /opt/explo && ./explo >> /proc/1/fd/1 2>&1"
4137 echo " $CRON_SCHEDULE $cmd " > " /var/spool/cron/crontabs/$CRON_USER "
6763
6864chmod 600 " /var/spool/cron/crontabs/$CRON_USER "
6965
66+
7067echo " [setup] Starting cron..."
68+ # Drop privileges after cron setup is done
69+ if [ " $( id -u) " = " 0" ]; then
70+ exec su-exec explo crond -f -l 2
71+ fi
72+
7173crond -f -l 2
You can’t perform that action at this time.
0 commit comments