Files
xteve_lazystream/entrypoint.sh
2020-02-26 16:00:57 -08:00

40 lines
982 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
crond -l 2
CRONJOB_FILE=/config/cronjob.sh
if [ -f "$CRONJOB_FILE" ]; then
echo "$CRONJOB_FILE already exists if changes are necessary please edit this file."
chmod +x $CRONJOB_FILE
chmod 777 $CRONJOB_FILE
else
echo "$CRONJOB_FILE does not exist, auto-generating cronjob file. Please edit to complete setup."
cp /cronjob.sh $CRONJOB_FILE
chmod +x $CRONJOB_FILE
chmod 777 $CRONJOB_FILE
fi
CRON_FILE=/config/cron.txt
if [ -f "$CRON_FILE" ]; then
. $CRON_FILE
else
echo "No cron definition found..."
echo "By default, cronjob will run every night at midnight unless cron file is configured."
printf '0 0 * * * /config/cronjob.sh' > /etc/crontabs/root
cp /sample_cron.txt /config/sample_cron.txt
fi
XTEVE_FILE=/config/xteve.txt
echo "Starting xTeVe..."
if [ -f "$XTEVE_FILE" ]; then
. $XTEVE_FILE
else
echo "Starting xTeVe with default config..."
cp /sample_xteve.txt /config/sample_xteve.txt
xteve -port=34400 -config=/root/.xteve/
fi
exit