update direwolf
This commit is contained in:
@@ -6,7 +6,7 @@ gui=true
|
|||||||
steps=cd src && make && make hamclock-web-1600x960 && mkdir -p $HOME/.local/bin && mv hamclock-web-1600x960 $HOME/.local/bin/hamclock
|
steps=cd src && make && make hamclock-web-1600x960 && mkdir -p $HOME/.local/bin && mv hamclock-web-1600x960 $HOME/.local/bin/hamclock
|
||||||
|
|
||||||
[direwolf]
|
[direwolf]
|
||||||
version=1.8.1
|
version=1.8.2
|
||||||
git=https://github.com/wb2osz/direwolf.git
|
git=https://github.com/wb2osz/direwolf.git
|
||||||
install=$HOME/.local/bin/direwolf
|
install=$HOME/.local/bin/direwolf
|
||||||
steps=mkdir build| cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local && make -j4 && sudo make install| sudo udevadm control --reload-rules| mkdir -p $HOME/.local/state/HamPack/conf.d
|
steps=mkdir build| cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local && make -j4 && sudo make install| sudo udevadm control --reload-rules| mkdir -p $HOME/.local/state/HamPack/conf.d
|
||||||
|
|||||||
78
hampackservercheck
Executable file
78
hampackservercheck
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
CONF="compile.conf"
|
||||||
|
|
||||||
|
if [ ! -f "$CONF" ]; then
|
||||||
|
echo "Error: compile.conf not found at $CONF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
github_owner_repo() {
|
||||||
|
local url="$1"
|
||||||
|
if [[ "$url" =~ github\.com/([^/]+)/([^/.]+) ]]; then
|
||||||
|
echo "${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
github_latest_tag() {
|
||||||
|
local owner_repo="$1"
|
||||||
|
local tag
|
||||||
|
tag=$(curl -sf "https://api.github.com/repos/$owner_repo/releases/latest" \
|
||||||
|
| grep '"tag_name"' \
|
||||||
|
| sed 's/.*"tag_name": *"\([^"]*\)".*/\1/' \
|
||||||
|
| sed 's/^v//')
|
||||||
|
if [ -z "$tag" ]; then
|
||||||
|
tag=$(curl -sf "https://api.github.com/repos/$owner_repo/tags" \
|
||||||
|
| grep '"name"' \
|
||||||
|
| head -1 \
|
||||||
|
| sed 's/.*"name": *"\([^"]*\)".*/\1/' \
|
||||||
|
| sed 's/^v//')
|
||||||
|
fi
|
||||||
|
echo "$tag"
|
||||||
|
}
|
||||||
|
|
||||||
|
current_section=""
|
||||||
|
current_version=""
|
||||||
|
current_url=""
|
||||||
|
|
||||||
|
check_section() {
|
||||||
|
[ -z "$current_section" ] && return
|
||||||
|
[ -z "$current_url" ] && return
|
||||||
|
|
||||||
|
local owner_repo
|
||||||
|
owner_repo=$(github_owner_repo "$current_url")
|
||||||
|
if [ -z "$owner_repo" ]; then
|
||||||
|
echo "$current_section: unable to determine GitHub repo from URL"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local latest
|
||||||
|
latest=$(github_latest_tag "$owner_repo")
|
||||||
|
if [ -z "$latest" ]; then
|
||||||
|
echo "$current_section: unable to fetch latest version"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$latest" = "$current_version" ]; then
|
||||||
|
echo "$current_section: up to date ($current_version)"
|
||||||
|
else
|
||||||
|
echo "$current_section: update available $current_version -> $latest"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
||||||
|
check_section
|
||||||
|
current_section="${BASH_REMATCH[1]}"
|
||||||
|
current_version=""
|
||||||
|
current_url=""
|
||||||
|
elif [[ "$line" =~ ^version=(.+)$ ]]; then
|
||||||
|
current_version="${BASH_REMATCH[1]}"
|
||||||
|
elif [[ "$line" =~ ^wget=(.+)$ ]]; then
|
||||||
|
current_url="${BASH_REMATCH[1]}"
|
||||||
|
elif [[ "$line" =~ ^git=(.+)$ ]]; then
|
||||||
|
current_url="${BASH_REMATCH[1]}"
|
||||||
|
fi
|
||||||
|
done < "$CONF"
|
||||||
|
|
||||||
|
check_section
|
||||||
@@ -67,6 +67,7 @@ git clone https://gitea.young.computer/david/HamPackServer.git "$HOME/.local/sha
|
|||||||
mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
cp "$HOME/.local/share/HamPackServer/hampackserverrefresh" "$HOME/.local/bin/hampackserverrefresh"
|
cp "$HOME/.local/share/HamPackServer/hampackserverrefresh" "$HOME/.local/bin/hampackserverrefresh"
|
||||||
cp "$HOME/.local/share/HamPackServer/hampackserverupdate" "$HOME/.local/bin/hampackserverupdate"
|
cp "$HOME/.local/share/HamPackServer/hampackserverupdate" "$HOME/.local/bin/hampackserverupdate"
|
||||||
|
cp "$HOME/.local/share/HamPackServer/hampackservercheck" "$HOME/.local/bin/hampackservercheck"
|
||||||
|
|
||||||
mkdir -p "$HOME/.local/share/hamclock"
|
mkdir -p "$HOME/.local/share/hamclock"
|
||||||
# Remove old user-level service if present
|
# Remove old user-level service if present
|
||||||
|
|||||||
Reference in New Issue
Block a user