32 lines
771 B
Bash
32 lines
771 B
Bash
#!/usr/bin/env bash
|
|
|
|
CPU_ARCH=""
|
|
# get the architecture
|
|
_cpu_arch=$(uname -m);
|
|
# weg get like x86_64 or x86_32 (NO), aarch64, etc
|
|
# we ONLY allow x86_64 or aarch64
|
|
# possible add: arm64
|
|
if [ "${_cpu_arch}" = "x86_64" ]; then
|
|
CPU_ARCH="amd64";
|
|
elif [ "${_cpu_arch}" = "aarch64" ] || [ "${_cpu_arch}" = "arm64" ]; then
|
|
CPU_ARCH="arm64";
|
|
else
|
|
echo "Not supported architecture: ${_cpu_arch}";
|
|
exit;
|
|
fi;
|
|
arch="linux-${CPU_ARCH}";
|
|
download_folder="${BASE_FOLDER}download/";
|
|
if [ ! -d "${download_folder}" ]; then
|
|
echo "Download folder ${download_folder} missing";
|
|
exit;
|
|
fi;
|
|
target_file="/usr/local/bin/gitea";
|
|
if [ ! -f "${target_file}" ]; then
|
|
echo "There is no gitea target file at ${target_file}. Is gitea installed?";
|
|
exit;
|
|
fi;
|
|
|
|
export arch target_file;
|
|
|
|
# __END__
|