Created
August 21, 2017 12:34
-
-
Save polyfloyd/93e07c7df18287753bb24ed6e75b21a9 to your computer and use it in GitHub Desktop.
Gitea Updater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Downloads a binary file from the internetz and makes it executable. What could possibly go wrong? :D | |
| INSTALL="/opt/gitea" | |
| set -eu | |
| set -o pipefail | |
| path=$(curl -sL https://github.com/go-gitea/gitea/releases/latest | sed -n 's/.*<a href="\([^"]\+linux-amd64\)".*$/\1/p') | |
| ofile=$INSTALL/$(basename "$path") | |
| if [ ! -e "$ofile" ]; then | |
| wget "https://github.com/$path" -o /dev/null -O "$ofile" | |
| chmod 755 "$ofile" | |
| ln -sf "$ofile" "$INSTALL/gitea" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment