Automatically backup current gitea binary
Bump to gitea version 1.9.4
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
## Installation of self hosted git service Gitea
|
||||
|
||||
toolName="gitea"
|
||||
giteaVersion="1.9.3"
|
||||
giteaVersion="1.9.4"
|
||||
giteaDownload="https://dl.gitea.io/gitea/${giteaVersion}/gitea-${giteaVersion}-linux-arm-6"
|
||||
giteaLoc="/usr/local/bin/gitea"
|
||||
giteaDir="/usr/local/bin"
|
||||
giteaLoc="${giteaDir}/gitea"
|
||||
giteaService="https://raw.githubusercontent.com/go-gitea/gitea/master/contrib/systemd/gitea.service"
|
||||
giteaServiceLoc="/etc/systemd/system/gitea.service"
|
||||
|
||||
@@ -137,11 +138,17 @@ step_12_info() { echo "Download new version to /usr/local/bin"; }
|
||||
step_12_alias() { ALIAS="upgrade"; }
|
||||
step_12() {
|
||||
if [ -f "$giteaLoc" ] ; then
|
||||
echo "Backup existing executable first"
|
||||
return 1;
|
||||
local versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
|
||||
local toolBackup="${giteaDir}/gitea_${versionNow}"
|
||||
exe service gitea stop
|
||||
saveReturn $?
|
||||
endReturn
|
||||
echo -n "Backuping up existing executable to ${toolBackup}..."
|
||||
exe cp -ar "$giteaLoc" "$toolBackup" && echo "ok"
|
||||
fi
|
||||
exe wget -O "$giteaLoc" $giteaDownload
|
||||
exe chmod +x "$giteaLoc"
|
||||
exe service gitea start
|
||||
}
|
||||
|
||||
step_20_info() { echo "Secure settings after installation"; }
|
||||
|
Reference in New Issue
Block a user