gitea-update/gitea-update.sh

29 lines
635 B
Bash
Raw Normal View History

2018-06-05 07:59:43 +02:00
#!/bin/bash
VERSION=1.4.2
2018-06-05 14:23:34 +02:00
2018-06-05 07:59:43 +02:00
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
2018-06-05 14:23:34 +02:00
echo "Downloading the newest version..."
2018-06-05 07:59:43 +02:00
wget -N https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-$ARCH -P $DIR/bin/
2018-06-05 14:23:34 +02:00
echo "Creating symlinks..."
2018-06-05 07:59:43 +02:00
ln -sfv $DIR/bin/gitea-$VERSION-$ARCH $DIR/gitea
2018-06-05 14:23:34 +02:00
echo "Fixing permissions..."
2018-06-05 07:59:43 +02:00
chmod -v +x $DIR/bin/gitea-$VERSION-$ARCH
2018-06-05 14:23:34 +02:00
echo "Restarting service..."
2018-06-05 07:59:43 +02:00
service gitea restart
service gitea status
2018-06-05 14:23:34 +02:00
# 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