Compare commits

...

9 Commits

Author SHA1 Message Date
David Young
c7106ba76b fix openhamclock service 2026-06-15 14:11:12 -06:00
David Young
f19873ee12 update direwolf 2026-06-06 06:19:51 -06:00
David Young
d04bd959d5 hamclock fixes 2026-06-06 06:04:44 -06:00
David Young
13f9a4cb39 fix hamclock service 2026-06-06 05:52:19 -06:00
David Young
fbb4803576 hamclock fixes 2026-06-05 16:02:01 -06:00
David Young
928f2918e2 update hamclock.service backend 2026-06-04 05:29:32 -06:00
David Young
09635c8232 hampack-service 2026-06-01 06:34:01 -06:00
David Young
5104d6255e Merge branch 'main' of https://gitea.young.computer/david/HamPackServer 2026-06-01 06:32:24 -06:00
David Young
86f6190181 update hamclock-service 2026-06-01 06:31:21 -06:00
7 changed files with 102 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
A collection of Ham Radio server utilities to transform CoreServer machines in to Ham Radio servers.
Update here.
```
wget -qO- https://gitea.young.computer/david/hampackserver/raw/branch/main/install.sh | bash
```

View File

@@ -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
[direwolf]
version=1.8.1
version=1.8.2
git=https://github.com/wb2osz/direwolf.git
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

78
hampackservercheck Executable file
View 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

View File

@@ -67,11 +67,18 @@ git clone https://gitea.young.computer/david/HamPackServer.git "$HOME/.local/sha
mkdir -p "$HOME/.local/bin"
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/hampackservercheck" "$HOME/.local/bin/hampackservercheck"
mkdir -p "$HOME/.config/systemd/user"
mkdir -p "$HOME/.local/share/hamclock"
cp "$HOME/.local/share/HamPackServer/servicefiles/hamclock.service" "$HOME/.config/systemd/user/"
systemctl --user enable hamclock
# Remove old user-level service if present
if [ -f "$HOME/.config/systemd/user/hamclock.service" ]; then
systemctl --user disable --now hamclock 2>/dev/null || true
rm "$HOME/.config/systemd/user/hamclock.service"
systemctl --user daemon-reload
fi
sed -e "s/__HAMCLOCK_USER__/$USER/g" -e "s|__HAMCLOCK_HOME__|$HOME|g" "$HOME/.local/share/HamPackServer/servicefiles/hamclock.service" | sudo tee /etc/systemd/system/hamclock.service > /dev/null
sudo systemctl daemon-reload
sudo systemctl enable hamclock
bash "$HOME/.local/share/HamPackServer/scripts/hamclock-cleanup.sh"
cd ~/.local/share/HamPackServer

View File

@@ -15,7 +15,7 @@ HAMCLOCK_DATA_FILES=(
)
echo "Stopping hamclock service..."
systemctl --user stop hamclock 2>/dev/null || true
sudo systemctl stop hamclock 2>/dev/null || true
mkdir -p "$NEW_DIR"
@@ -27,7 +27,7 @@ for f in "${HAMCLOCK_DATA_FILES[@]}"; do
done
echo "Reloading hamclock service..."
systemctl --user daemon-reload
systemctl --user restart hamclock
sudo systemctl daemon-reload
sudo systemctl restart hamclock
echo "hamclock cleanup done."

View File

@@ -1,14 +1,16 @@
[Unit]
Description=HamClock
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=HOME=%h
WorkingDirectory=%h/.local/share/hamclock
ExecStart=%h/.local/bin/hamclock
User=__HAMCLOCK_USER__
Environment=HOME=__HAMCLOCK_HOME__
WorkingDirectory=__HAMCLOCK_HOME__/.local/share/hamclock
ExecStart=__HAMCLOCK_HOME__/.local/bin/hamclock -b ohb.hamclock.app:80
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
WantedBy=multi-user.target

View File

@@ -5,7 +5,7 @@ After=network.target
[Service]
Type=simple
WorkingDirectory=%h/.local/bin/openhamclock
ExecStart=/usr/bin/pm2 start server.js
ExecStart=/usr/bin/node server.js
Restart=on-failure
RestartSec=5