gitea-update/gitea-update.sh

36 lines
636 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
if [ -f $DIR/bin/gitea-$VERSION-$ARCH ]; then
2018-06-05 07:59:43 +02:00
echo "Latest version is already downloaded!"
2018-06-05 07:59:43 +02:00
else
echo "Downloading the newest version..."
wget -N https://dl.gitea.io/gitea/$VERSION/gitea-$VERSION-$ARCH -P $DIR/bin/
echo "Creating symlinks..."
ln -sfv $DIR/bin/gitea-$VERSION-$ARCH $DIR/gitea
echo "Fixing permissions..."
chmod -v +x $DIR/bin/gitea-$VERSION-$ARCH
echo "Restarting service..."
service gitea restart
2018-06-05 14:23:34 +02:00
fi
service gitea status
2018-06-05 14:23:34 +02:00