This commit is contained in:
Stephan Raabe
2024-01-18 14:59:44 +01:00
parent 46f6d25181
commit 696bd36be8
3 changed files with 25 additions and 4 deletions

17
.version/update.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Check for internet connection
if ping -q -c 1 -W 1 google.com >/dev/null; then
version=$(cat ~/dotfiles/.version/version)
online=$(curl -s https://gitlab.com/stephan-raabe/dotfiles/-/raw/main/.version/version?ref_type=heads)
if [ "$version" -lt "$online" ]; then
# Update available
echo "0"
else
# No update available
echo "1"
fi
else
# Network is down
echo "1"
fi