-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[close #169]: pre-run vso shell at boot if already initialized
fix: wrong path feat: add custom script to check for connectivity feat: improve network connectivity check
- Loading branch information
1 parent
c41c9cf
commit bcf3d72
Showing
3 changed files
with
38 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
is_network_online() { | ||
nmcli -t g | grep -q "connected" | ||
return $? | ||
} | ||
|
||
retry_count=0 | ||
max_retries=30 | ||
|
||
until is_network_online; do | ||
if [ $retry_count -ge $max_retries ]; then | ||
echo "Network not available after 1 minute. Exiting." | ||
exit 1 | ||
fi | ||
echo "Waiting for network..." | ||
sleep 2 | ||
((retry_count++)) | ||
done | ||
|
||
echo "Network is online." |
10 changes: 10 additions & 0 deletions
10
includes.container/usr/lib/systemd/user/vso-pre-run.service
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=VSO Shell Pre-Run | ||
|
||
[Service] | ||
ExecStartPre=/usr/bin/wait-for-connection | ||
ExecStart=/usr/bin/vso run -n -- ls || true | ||
Restart=always | ||
|
||
[Install] | ||
WantedBy=default.target |
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