-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dietpi: make sure update-os isn't interrupted when triggered from web…
…interface dietpi-update stops adsb-setup, so when called from adsb-setup it will kill itself and leave the system without adsb-setup running fix this by calling update-os via systemd-run in a transient systemd unit
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/modules/adsb-feeder/filesystem/root/opt/adsb/scripts/update-os
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
#!/bin/bash | ||
# do an OS update - either using the DietPi update tool or by just using apt | ||
|
||
# log to /run/adsb-feeder-image.log | ||
exec &>> /run/adsb-feeder-image.log | ||
|
||
if [ -x /boot/dietpi/dietpi-update ] ; then | ||
G_INTERACTIVE=0 CONFIG_CHECK_APT_UPDATES=2 /boot/dietpi/dietpi-update 1 | ||
else | ||
apt update | ||
apt upgrade -y | ||
fi | ||
|
||
# restart important services if not running for some reason | ||
# dietpi-update will stop adsb-setup / adsb-docker (dietpi services?!) | ||
# it should start it back up but let's just be safe here | ||
if ! systemctl is-active adsb-update.service; then | ||
systemctl restart adsb-update.service | ||
fi | ||
if ! systemctl is-active adsb-docker.service; then | ||
systemctl restart adsb-docker.service | ||
fi |