Skip to content

Commit 8dc618f

Browse files
committed
gluon-autoupdater: add invocation flag
Add a flag to signal Gluon after an upgrade it was in fact updated from an automatic upgrade. Signed-off-by: David Bauer <[email protected]>
1 parent 69fadd1 commit 8dc618f

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

package/gluon-autoupdater/files/lib/gluon/autoupdater/lib.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ start_enabled() {
1414
/etc/init.d/"$1" start
1515
fi
1616
}
17+
18+
flag_invocation() {
19+
if [ "$1" -eq "0" ]; then
20+
rm -f /lib/gluon/autoupdater/upgrade-invocation
21+
else
22+
echo "$1" > /lib/gluon/autoupdater/upgrade-invocation
23+
fi
24+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
. /lib/gluon/autoupdater/lib.sh
4+
5+
6+
autoupdater_invocation_remove() {
7+
# flag_invocation 0
8+
}
9+
10+
boot_hook_add preinit_main autoupdater_invocation_remove
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lib/gluon/autoupdater/upgrade-invocation

package/gluon-autoupdater/files/usr/lib/autoupdater/abort.d/90gluon-autoupdater

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
. /lib/gluon/autoupdater/lib.sh
44

5+
flag_invocation 0
56

67
start_enabled cron
78
start_enabled urngd

package/gluon-autoupdater/files/usr/lib/autoupdater/download.d/10gluon-autoupdater

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
. /lib/gluon/autoupdater/lib.sh
44

5+
flag_invocation 1
56

67
stop cron
78
stop urngd

0 commit comments

Comments
 (0)