Skip to content

Commit

Permalink
Post update should wait for network availability.
Browse files Browse the repository at this point in the history
  • Loading branch information
fewtarius committed Jul 10, 2024
1 parent 435ae00 commit 6cbcbe3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PKGBUILD/steamfork-customizations-jupiter/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pkgname=steamfork-customizations-jupiter
pkgver=2024.07.10
pkgrel=2
pkgrel=3
pkgdesc='SteamFork customizations provider.'
arch=('any')
url='http://www.steamfork.org'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2024-Present Fewtarius (https://github.com/fewtarius)

function check_network() {
GW=$(ip route | awk '/eth0/ {a=$0} END{print $1}')
if [[ ${GW} =~ [0-9] ]]
then
echo true
else
echo false
fi
}

### We should wait for network to come online before proceeding so
### any post-update hooks that need it will succeed.

while true
do
AM_I_ONLINE=$(check_network)
if [ "${AM_I_ONLINE}" = "true" ]
then
break
fi
sleep 1
done

### Check for the last update stamp, and if it isn't a match
### run any post-update scripts and then update the stamp.

UPDATE_STAMP="/etc/post-update.last"
source /etc/os-release
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[Unit]
Description=SteamFork post update service
Before=display-manager.service
After=network.target

[Service]
Type=oneshot
Expand Down

0 comments on commit 6cbcbe3

Please sign in to comment.