Created
April 11, 2021 23:07
-
-
Save userdocs/0630c6202581a4637c01aeeb09f19cd4 to your computer and use it in GitHub Desktop.
an example znc install script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# | |
#shellcheck source=sources/functions/utils | |
. /etc/swizzin/sources/functions/utils | |
#shellcheck source=sources/functions/os | |
. /etc/swizzin/sources/functions/os | |
#shellcheck source=sources/functions/app_port | |
. /etc/swizzin/sources/functions/app_port | |
#shellcheck source=sources/functions/ip | |
. /etc/swizzin/sources/functions/ip | |
# | |
username="$(_get_master_username)" # Get our main user name to use when bootstrapping filebrowser. | |
password="$(_get_user_password "${username}")" # Get our main password name to use when bootstrapping filebrowser. | |
app_proxy_port="$(_get_app_port "$(basename -- "$0" \.sh)")" # Get our app port using the install script name as the app name | |
external_ip="$(_external_ip)" # Get our external IP | |
# | |
apt-get install -y build-essential libssl-dev libperl-dev pkg-config libicu-dev | |
cmake_version="$(git ls-remote -t --refs https://github.com/Kitware/CMake.git | awk '{sub("refs/tags/v", "");sub("(.*)(-alpha|-rc*)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)" | |
case "$(_os_arch)" in | |
"amd64") app_arch="x86_64" ;; | |
"armhf") app_arch="error" ;; | |
"arm64") app_arch="aarch64" ;; | |
*) | |
echo_error "Arch not supported" | |
exit 1 | |
;; | |
esac | |
cmake_url="https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-${app_arch}.sh" | |
wget -qO "/tmp/cmake.sh" "${cmake_url}" | |
mkdir -p "/opt/cmake" | |
bash /tmp/cmake.sh --prefix="/opt/cmake" --skip-license | |
znc_version="$(git ls-remote -t --refs https://github.com/znc/znc.git | awk '{sub("refs/tags/", "");sub("(.*)(-alpha|-rc*)(.*)", ""); print $2 }' | awk '!/^$/' | sort -rV | head -n1)" | |
[[ -d /tmp/znc ]] && rm -rf /tmp/znc | |
git clone --no-tags --single-branch --branch "${znc_version}" --shallow-submodules --recurse-submodules -j"$(nproc)" --depth 1 https://github.com/znc/znc.git "/tmp/znc" | |
mkdir -p /tmp/znc/build | |
cd /tmp/znc/build | |
/opt/cmake/bin/cmake .. -DCMAKE_INSTALL_PREFIX="/opt/znc" | |
make -j"$(nproc)" | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment