Commit 9c377a32 authored by Bob Mottram's avatar Bob Mottram

Timer in minutes

parent 515d1e53
......@@ -42,11 +42,14 @@ SYNCHRONOUS=
USE_BUILD_LOG=no
# frequency that the timer checks for new builds
BUILD_TIMER_SEC=1200
BUILD_TIMER_MIN=20
# how long to wait after boot to start the daemon
BOOT_DELAY_SEC=$((20 + RANDOM % 100))
function show_help {
echo ''
echo $"${APP_NAME} -d [directory] --repo [git repo url] --branch [branch] --script [build script] --install [daemon name] -w [html file] --remove [daemon name] --header [text] -e [email address] --images [yes|no] --root [yes|no] --xmpp [adminJID] --synchronous [yes|no] --build-log [yes|no] --timer [seconds]"
echo $"${APP_NAME} -d [directory] --repo [git repo url] --branch [branch] --script [build script] --install [daemon name] -w [html file] --remove [daemon name] --header [text] -e [email address] --images [yes|no] --root [yes|no] --xmpp [adminJID] --synchronous [yes|no] --build-log [yes|no] --timer [mins]"
echo ''
exit 0
}
......@@ -384,7 +387,7 @@ case $key in
;;
--timer|--freq|--frequency)
shift
BUILD_TIMER_SEC="$1"
BUILD_TIMER_MIN="$1"
;;
--synchronous|--noparallel)
shift
......@@ -507,8 +510,8 @@ if [ "$DAEMON" ]; then
echo "Description=birb timer for $DAEMON";
echo '';
echo '[Timer]';
echo "OnUnitActiveSec=${BUILD_TIMER_SEC}s";
echo "OnBootSec=${BUILD_TIMER_SEC}s";
echo "OnUnitActiveSec=${BUILD_TIMER_MIN}min";
echo "OnBootSec=${BOOT_DELAY_SEC}s";
echo '';
echo '[Install]';
echo 'WantedBy=timers.target'; } > "/etc/systemd/system/${DAEMON}.timer"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment