Skip to content

Commit

Permalink
LoxBerry Update cronjobs
Browse files Browse the repository at this point in the history
- Renamed cron symlinks to loxberryupdate_cron (was: loxberryupdate_cron.sh)

run-parts does not execute jobs with file extension
  • Loading branch information
christianTF committed Dec 26, 2017
1 parent 66c0c31 commit 5072112
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions sbin/loxberryinit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,31 @@ case "$1" in
log_action_begin_msg "Checking consistence of LoxBerry Update settings"
echo Update-Settings: INSTALLTYPE is $UPDATEINSTALLTYPE, INTERVAL is $UPDATEINTERVAL
if [ "$UPDATEINSTALLTYPE" = "notify" ] || [ "$UPDATEINSTALLTYPE" = "install" ]; then
if [ "$UPDATEINTERVAL" = "1" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh" ]; then
if [ "$UPDATEINTERVAL" = "1" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron" ]; then
log_warning_msg "Recreated daily cronjob"
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh"
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh"; fi
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron"
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron"; fi
fi
if [ "$UPDATEINTERVAL" = "7" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh" ]; then
if [ "$UPDATEINTERVAL" = "7" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron" ]; then
log_warning_msg "Recreated weekly cronjob"
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh"
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh"; fi
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron"
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron"; fi

fi
if [ "$UPDATEINTERVAL" = "30" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh" ]; then
if [ "$UPDATEINTERVAL" = "30" ] && [ ! -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron" ]; then
log_warning_msg "Recreated monthly cronjob"
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh"
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh"; fi
ln -s "$LBHOMEDIR/sbin/loxberryupdate_cron.sh" "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron"
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron"; fi

fi
else
log_action_cont_msg "Updates are disabled, checking and deleting cronjobs"
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron.sh"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.daily/loxberryupdate_cron"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.weekly/loxberryupdate_cron"; fi
if [ -e "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron" ]; then rm "$LBHOMEDIR/system/cron/cron.monthly/loxberryupdate_cron"; fi
fi
log_action_end_msg 0

Expand Down
12 changes: 6 additions & 6 deletions webfrontend/htmlauth/system/tools/ajax-config-handler.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ sub lbupdate

if ($action eq 'lbupdate-installtime') {
if ($value eq '1' || $value eq '7' || $value eq '30') {
unlink "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron.sh" if (-e "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron.sh");
unlink "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron.sh" if (-e "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron.sh");
unlink "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron.sh" if (-e "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron.sh");
unlink "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron" if (-e "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron");
unlink "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron" if (-e "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron");
unlink "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron" if (-e "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron");

if ($value eq '1') {
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron.sh" or print STDERR "Error linking $lbhomedir/system/cron/cron.daily/loxberryupdate_cron.sh";
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.daily/loxberryupdate_cron" or print STDERR "Error linking $lbhomedir/system/cron/cron.daily/loxberryupdate_cron";
} elsif ($value eq '7') {
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron.sh" or print STDERR "Error linking $lbhomedir/system/cron/cron.weekly/loxberryupdate_cron.sh";
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.weekly/loxberryupdate_cron" or print STDERR "Error linking $lbhomedir/system/cron/cron.weekly/loxberryupdate_cron";
} elsif ($value eq '30') {
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron.sh" or print STDERR "Error linking $lbhomedir/system/cron/cron.monthly/loxberryupdate_cron.sh";
symlink "$lbssbindir/loxberryupdate_cron.sh", "$lbhomedir/system/cron/cron.monthly/loxberryupdate_cron" or print STDERR "Error linking $lbhomedir/system/cron/cron.monthly/loxberryupdate_cron";
}
change_generalcfg('UPDATE.INTERVAL', $value);
}
Expand Down

0 comments on commit 5072112

Please sign in to comment.