|
|
|
@ -21,11 +21,11 @@ function as() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ -f "$GITEA_BIN" ]; then
|
|
|
|
|
installed=$(cd "$GITEA_DIR" && as "$GITEA_BIN" --version | grep -Po "(?<=version )\d+(\.\d+)*(?= )");
|
|
|
|
|
installed=$(cd "$GITEA_DIR" && as "$GITEA_BIN" --version | grep --only-matching --perl-regexp "(?<=version )\d+(\.\d+)*(?= )");
|
|
|
|
|
else
|
|
|
|
|
installed=0;
|
|
|
|
|
fi
|
|
|
|
|
version=$(curl -s https://blog.gitea.io/index.xml | grep -Po '<title>.*</title>' | grep -Po '\d+(\.\d+)+' | sort -rn | head -n 1);
|
|
|
|
|
version=$(curl --silent https://blog.gitea.io/index.xml | grep --only-matching --perl-regexp '<title>.*</title>' | grep --only-matching --perl-regexp '\d+(\.\d+)+' | sort --numeric-sort --reverse | head --lines=1);
|
|
|
|
|
address="https://dl.gitea.io/gitea/$version";
|
|
|
|
|
binary="gitea-$version-linux-amd64";
|
|
|
|
|
signature="$binary.asc";
|
|
|
|
@ -46,7 +46,7 @@ fi
|
|
|
|
|
cd "$GITEA_DIR";
|
|
|
|
|
|
|
|
|
|
for a in "$binary" "$signature" "$checksum"; do
|
|
|
|
|
if ! wget --quiet -O "$a" "$address/$a"; then
|
|
|
|
|
if ! wget --quiet -output-document="$a" "$address/$a"; then
|
|
|
|
|
error "Failed to download $a";
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
@ -56,7 +56,7 @@ if ! "$CHECKSUM_APP" --quiet --check "$checksum"; then
|
|
|
|
|
error "Checksum not correct!";
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
if ! (gpg --status-fd 1 --verify "$signature" "$binary" 2>/dev/null | grep -P 'VALIDSIG .* '"$GPG_FINGERPRINT" > /dev/null); then
|
|
|
|
|
if ! (gpg --status-fd 1 --verify "$signature" "$binary" 2>/dev/null | grep --perl-regexp 'VALIDSIG .* '"$GPG_FINGERPRINT" > /dev/null); then
|
|
|
|
|
error "Signature not valid!";
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
@ -65,7 +65,7 @@ rm "$checksum";
|
|
|
|
|
rm "$signature";
|
|
|
|
|
|
|
|
|
|
mv "$binary" "$GITEA_BIN";
|
|
|
|
|
chmod 0754 "$GITEA_BIN";
|
|
|
|
|
chmod u=rwx,g=rx,o=r "$GITEA_BIN";
|
|
|
|
|
chown root:"$GITEA_USER" "$GITEA_BIN"
|
|
|
|
|
|
|
|
|
|
if [[ ! "$installed" = "0" ]]; then
|
|
|
|
|