This commit is contained in:
Deni 2018-06-05 14:23:34 +02:00
parent 716eb31ba1
commit d4425dd2c7
1 changed files with 12 additions and 7 deletions

View File

@ -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