fix restart of act runner after update when downloading gitea or act runner it will show the version that is downlaoded. if the same version is downloaded again and alrady exists, download will be skipped
24 lines
623 B
Bash
Executable File
24 lines
623 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/";
|
|
# shellcheck source=init.sh
|
|
. "${BASE_FOLDER}init.sh";
|
|
|
|
if [ -z "${1}" ]; then
|
|
echo "Please give a Gitea Action Runner version to upgrade to";
|
|
exit;
|
|
fi;
|
|
if [ ! -f "${download_folder}act_runner-${1}-${arch}" ]; then
|
|
echo "Cannot find file: ${download_folder}act_runner-${1}-${arch}";
|
|
exit;
|
|
fi;
|
|
|
|
echo -e "Update gitea action runner to ${1} ... ";
|
|
systemctl stop act_runner;
|
|
cp "${download_folder}act_runner-${1}-${arch}" "${target_file_act_runner}";
|
|
chmod +x "${target_file_act_runner}";
|
|
systemctl start act_runner;
|
|
echo "[DONE]";
|
|
|
|
# __END__
|