mirror of
https://github.com/YuzuZensai/palworld-server-docker.git
synced 2026-01-06 04:32:43 +00:00
feat: ✨ Add variables Env for cron feature
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
printf "\e[0;34m***** RUNNING SCRIPTS start.sh *****\e[0m\n"
|
||||
|
||||
STARTCOMMAND="./PalServer.sh"
|
||||
|
||||
if [ -n "${PORT}" ]; then
|
||||
@@ -69,6 +67,21 @@ if [ -n "${RCON_PORT}" ]; then
|
||||
sed -i "s/RCONPort=[0-9]*/RCONPort=$RCON_PORT/" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
fi
|
||||
|
||||
if [[ -n "${BACKUP_ENABLED}" ]]; then
|
||||
echo "BACKUP_ENABLED=${BACKUP_ENABLED}"
|
||||
|
||||
if [[ -z "${BACKUP_CRON_EXPRESSION}" ]]; then
|
||||
printf "\e[0;31m***** BACKUP_CRON_EXPRESSION NOT SET *****\e[0m\n"
|
||||
exit 1
|
||||
else
|
||||
echo "BACKUP_CRON_EXPRESSION=${BACKUP_CRON_EXPRESSION}"
|
||||
fi
|
||||
|
||||
echo "${BACKUP_CRON_EXPRESSION} root bash /usr/local/bin/backup" > /etc/cron.d/backups-cron
|
||||
chmod 0644 /etc/cron.d/backups-cron
|
||||
cron /etc/cron.d/backups-cron
|
||||
fi
|
||||
|
||||
# Configure RCON settings
|
||||
cat >~/.rcon-cli.yaml <<EOL
|
||||
host: localhost
|
||||
|
||||
Reference in New Issue
Block a user