From d4425dd2c786c78cedc39e1854ba63e86a620512 Mon Sep 17 00:00:00 2001 From: b4d Date: Tue, 5 Jun 2018 14:23:34 +0200 Subject: [PATCH] Cleanup --- gitea-update.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gitea-update.sh b/gitea-update.sh index 32c59af..141cd43 100755 --- a/gitea-update.sh +++ b/gitea-update.sh @@ -1,23 +1,28 @@ #!/bin/bash -# dodaj argument $1 za verzijo in spremenljivko za arch (a to lahko iz sistema potegne?) - -# Create a bin dir under your gitea install folder VERSION=1.4.2 + + DIR=/opt/gitea ARCH=linux-amd64 #darwin-10.6.386 darwin-10.6-amd64 linux-386 linux-arm-5,6,7,arm64,mips,mips64,mips64le -echo "Trying to download the newest version" +echo "Downloading the newest version..." wget -N https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-$ARCH -P $DIR/bin/ -echo "Creating symlinks" +echo "Creating symlinks..." ln -sfv $DIR/bin/gitea-$VERSION-$ARCH $DIR/gitea -echo "Fixing permissions" +echo "Fixing permissions..." chmod -v +x $DIR/bin/gitea-$VERSION-$ARCH -echo "Restarting service" +echo "Restarting service..." service gitea restart service gitea status + +# check if $DIR/bin exists otherwise create it +# try to download new version +# if you have the latest, break and exit +# else do other things +