server/gitea: update_gitea expanded arguments for readability

dehydrated
Felix Stupp 5 years ago
parent 5a392cd5d0
commit cf15eff4f4
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -21,11 +21,11 @@ function as() {
} }
if [ -f "$GITEA_BIN" ]; then 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 else
installed=0; installed=0;
fi 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"; address="https://dl.gitea.io/gitea/$version";
binary="gitea-$version-linux-amd64"; binary="gitea-$version-linux-amd64";
signature="$binary.asc"; signature="$binary.asc";
@ -46,7 +46,7 @@ fi
cd "$GITEA_DIR"; cd "$GITEA_DIR";
for a in "$binary" "$signature" "$checksum"; do 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"; error "Failed to download $a";
exit 1; exit 1;
fi fi
@ -56,7 +56,7 @@ if ! "$CHECKSUM_APP" --quiet --check "$checksum"; then
error "Checksum not correct!"; error "Checksum not correct!";
exit 1; exit 1;
fi 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!"; error "Signature not valid!";
exit 1; exit 1;
fi fi
@ -65,7 +65,7 @@ rm "$checksum";
rm "$signature"; rm "$signature";
mv "$binary" "$GITEA_BIN"; mv "$binary" "$GITEA_BIN";
chmod 0754 "$GITEA_BIN"; chmod u=rwx,g=rx,o=r "$GITEA_BIN";
chown root:"$GITEA_USER" "$GITEA_BIN" chown root:"$GITEA_USER" "$GITEA_BIN"
if [[ ! "$installed" = "0" ]]; then if [[ ! "$installed" = "0" ]]; then

Loading…
Cancel
Save