Fixed CT's NodeRed (Missing setting) and Gitea (Broken updater)

CT NodeRed: Fixed missing config file by adding 5sec wait time before ending pm2 on setup to generate it
CT Gitea: moved from `gitea-auto-update`  from to an basic sh script since it is broken on AlpineLinux
This commit is contained in:
2025-01-10 19:30:45 +01:00
parent bb07d31c83
commit a647ab711b
6 changed files with 35 additions and 28 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/ash
#Check if Gitea is running
case $(service gitea status) in
*started*);;
*)
echo "Gitea is not running, exiting"
exit ;;
esac
#Check internet connection
if ! ping -c 2 api.github.com &> /dev/null; then echo "No internet connection detected, exiting";exit ;fi
#Get latest vesion
NewGiteaVer=$(curl --retry 7 --retry-delay 5 -Ls https://api.github.com/repos/go-gitea/gitea/releases/latest |jq -r .tag_name)
CurGiteaVer=$(curl --retry 7 --retry-delay 5 -Ls http://localhost:3000/api/v1/version |jq -r .version)
#Compare versions to check for update
if [ "$NewGiteaVer" = "$CurGiteaVer" ] ; then
echo 'Gitea up-to-date'
exit
else
echo 'Updating Gitea'
service gitea stop
mv /usr/local/bin/gitea /usr/local/bin/gitea.old
curl --retry 7 --retry-delay 5 -L https://dl.gitea.io/gitea/"${NewGiteaVer//v}"/gitea-"${NewGiteaVer//v}"-linux-amd64 -o /usr/local/bin/gitea
chmod +x /usr/local/bin/gitea
service gitea start
fi