mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "6f0788f220436e67ec334874d267f09d5d8ddc8d" and "16a37644bb5db06b3cbdd5c0f77609232ac9dcd7" have entirely different histories.
6f0788f220
...
16a37644bb
|
@ -6,7 +6,6 @@
|
|||
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
||||
|
||||
function header_info {
|
||||
clear
|
||||
cat <<"EOF"
|
||||
______ _ __ __
|
||||
/_ __/___ _(_) /_____________ _/ /__
|
||||
|
@ -16,8 +15,8 @@ cat <<"EOF"
|
|||
|
||||
EOF
|
||||
}
|
||||
clear
|
||||
header_info
|
||||
set-e
|
||||
while true; do
|
||||
read -p "This will add Tailscale to an existing LXC Container ONLY. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
|
@ -26,7 +25,23 @@ while true; do
|
|||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
|
||||
set -o errexit
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
shopt -s expand_aliases
|
||||
alias die='EXIT=$? LINE=$LINENO error_exit'
|
||||
trap die ERR
|
||||
|
||||
function error_exit() {
|
||||
trap - ERR
|
||||
local reason="Unknown failure occured."
|
||||
local msg="${1:-$reason}"
|
||||
local flag="\e[1;31m‼ ERROR\e[0m $EXIT@$LINE"
|
||||
echo -e "$flag $msg" 1>&2
|
||||
exit $EXIT
|
||||
}
|
||||
function msg() {
|
||||
local TEXT="$1"
|
||||
echo -e "$TEXT"
|
||||
|
|
|
@ -28,7 +28,7 @@ CM="${GN}✓${CL}"
|
|||
silent() { "$@" >/dev/null 2>&1; }
|
||||
set -e
|
||||
header_info
|
||||
echo "Loading..."
|
||||
|
||||
function msg_info() {
|
||||
local msg="$1"
|
||||
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||
|
@ -40,7 +40,6 @@ function msg_ok() {
|
|||
}
|
||||
|
||||
install() {
|
||||
header_info
|
||||
while true; do
|
||||
read -p "Are you sure you want to install NetData on Proxmox VE host. Proceed(y/n)?" yn
|
||||
case $yn in
|
||||
|
@ -49,7 +48,7 @@ install() {
|
|||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
header_info
|
||||
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
|
@ -67,13 +66,12 @@ install() {
|
|||
msg_info "Installing Netdata"
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y netdata
|
||||
msg_ok "Installed Netdata"
|
||||
msg_ok "Installed Netdata\n"
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "\n Netdata should be reachable at${BL} http://$(hostname -I | awk '{print $1}'):19999 ${CL}\n"
|
||||
}
|
||||
|
||||
uninstall() {
|
||||
header_info
|
||||
read -r -p "Verbose mode? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
STD=""
|
||||
|
@ -90,7 +88,7 @@ uninstall() {
|
|||
systemctl daemon-reload
|
||||
$STD apt autoremove -y
|
||||
$STD userdel netdata
|
||||
msg_ok "Uninstalled Netdata"
|
||||
msg_ok "Uninstalled Netdata\n"
|
||||
msg_ok "Completed Successfully!\n"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue