From ae8482c883c18561017d126fa35615c9d00058f8 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Tue, 28 May 2019 18:38:08 +0200 Subject: [PATCH] roles/server/gitea: Removed old file update_gitea.sh Replaced by template update_gitea.sh --- roles/server/gitea/files/update_gitea.sh | 64 ------------------------ 1 file changed, 64 deletions(-) delete mode 100644 roles/server/gitea/files/update_gitea.sh diff --git a/roles/server/gitea/files/update_gitea.sh b/roles/server/gitea/files/update_gitea.sh deleted file mode 100644 index f138c4e..0000000 --- a/roles/server/gitea/files/update_gitea.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -e; - -function error() { - echo $@ >&2; -} - -function as() { - sudo -u git $@; -} - -checksumType="sha256"; - -checksumApp="${checksumType}sum"; -installed=$(cd ~git && as ./gitea --version | grep -Po "(?<=version )\d+(\.\d+)*(?= )") -version=$(curl -s https://blog.gitea.io/index.xml | grep -Po '.*' | grep -Po '\d+(\.\d+)+' | sort -rn | head -n 1); -address="https://dl.gitea.io/gitea/$version"; -binary="gitea-$version-linux-amd64"; -signature="$binary.asc"; -checksum="$binary.$checksumType"; - -if [[ -z "$installed" ]]; then - error "Missing version installed"; - exit 2; -fi -if [[ -z "$version" ]]; then - error "Missing version available"; - exit 2; -fi -echo "Installed $installed, available $version"; -if [[ "$installed" = "$version" ]]; then - echo "No update required"; - exit 0; -fi -echo "Update to $version"; - -cd /home/git; - -for a in "$binary" "$signature" "$checksum"; do - if ! wget --quiet -O "$a" "$address/$a"; then - error "Failed to download $a"; - exit 1; - fi -done - -if ! "$checksumApp" --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 .* 7C9E68152594688862D62AF62D9AE806EC1592E2' > /dev/null); then - error "Signature not valid!"; - exit 1; -fi - -rm "$checksum"; -rm "$signature"; - -as ./gitea dump #-c custom/conf/app.ini; - -mv "$binary" gitea; -chmod o+rx gitea; - -supervisorctl restart git.banananet.work;