Skip to content

Commit ab27fc3

Browse files
mf-fxMarcus Funch
authored andcommitted
Andreas' suggestion: Make shutdown_and_wakeup and shutdown_at_time disable each other
1 parent 0b22e8d commit ab27fc3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

os2borgerpc/os2borgerpc/shutdown_and_wakeup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ MESSAGE="Denne computer lukker ned om fem minutter"
4545
crontab -l > $ROOTCRON_TMP
4646
crontab -u user -l > $USERCRON_TMP
4747

48-
# Delete current crontab entries related to this script
49-
sed --in-place --expression "/rtcwake/d" --expression "/scheduled_off/d" $ROOTCRON_TMP
48+
# Delete current crontab entries related to this script AND shutdown_at_time
49+
sed --in-place --expression "/rtcwake/d" --expression "/scheduled_off/d" --expression "/shutdown/d" $ROOTCRON_TMP
5050
sed --in-place "/lukker/d" $USERCRON_TMP
5151

5252
if [ "$1" == "--off" ]; then

os2borgerpc/os2borgerpc/shutdown_at_time.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ MESSAGE="Denne computer lukker ned om fem minutter"
3636
crontab -l > $ROOTCRON_TMP
3737
crontab -u user -l > $USERCRON_TMP
3838

39-
# Delete current crontab entries related to this script
40-
sed --in-place "/shutdown/d" $ROOTCRON_TMP
39+
# Delete current crontab entries related to this script AND shutdown_and_wakeup.sh
40+
sed --in-place --expression "/shutdown/d" --expression "/rtcwake/d" --expression "/scheduled_off/d" $ROOTCRON_TMP
4141
sed --in-place "/lukker/d" $USERCRON_TMP
4242

4343
# If not called with --off: Determine the new crontab contents

0 commit comments

Comments
 (0)