Add no version or version not found check for install

This commit is contained in:
Clemens Schwaighofer
2024-08-28 10:14:04 +09:00
parent aca80a9775
commit f8fa542278

View File

@@ -4,6 +4,15 @@ BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/";
# shellcheck source=init.sh
. "${BASE_FOLDER}init.sh";
if [ -z "${1}" ]; then
echo "Please give a Gitea version to upgrade to";
exit;
fi;
if [ ! -f "${download_folder}gitea-${1}-${arch}" ]; then
echo "Cannot find file: ${download_folder}gitea-${1}-${arch}";
exit;
fi;
echo -e "Update gitea to ${1} ... ";
systemctl stop gitea;
cp "${download_folder}gitea-${1}-${arch}" "${target_file}";