Compare commits

...

2 Commits

Author SHA1 Message Date
tteckster 6f0788f220
Update add-tailscale-lxc.sh
tweak
2023-12-22 19:51:33 -05:00
tteckster 79a542cd5a
Update netdata.sh
tweak
2023-12-22 19:45:53 -05:00
2 changed files with 12 additions and 25 deletions

View File

@ -6,6 +6,7 @@
# https://github.com/tteck/Proxmox/raw/main/LICENSE # https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info { function header_info {
clear
cat <<"EOF" cat <<"EOF"
______ _ __ __ ______ _ __ __
/_ __/___ _(_) /_____________ _/ /__ /_ __/___ _(_) /_____________ _/ /__
@ -15,8 +16,8 @@ cat <<"EOF"
EOF EOF
} }
clear
header_info header_info
set-e
while true; do while true; do
read -p "This will add Tailscale to an existing LXC Container ONLY. Proceed(y/n)?" yn read -p "This will add Tailscale to an existing LXC Container ONLY. Proceed(y/n)?" yn
case $yn in case $yn in
@ -25,23 +26,7 @@ while true; do
*) echo "Please answer yes or no." ;; *) echo "Please answer yes or no." ;;
esac esac
done 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() { function msg() {
local TEXT="$1" local TEXT="$1"
echo -e "$TEXT" echo -e "$TEXT"

View File

@ -28,7 +28,7 @@ CM="${GN}✓${CL}"
silent() { "$@" >/dev/null 2>&1; } silent() { "$@" >/dev/null 2>&1; }
set -e set -e
header_info header_info
echo "Loading..."
function msg_info() { function msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..." echo -ne " ${HOLD} ${YW}${msg}..."
@ -40,6 +40,7 @@ function msg_ok() {
} }
install() { install() {
header_info
while true; do while true; do
read -p "Are you sure you want to install NetData on Proxmox VE host. Proceed(y/n)?" yn read -p "Are you sure you want to install NetData on Proxmox VE host. Proceed(y/n)?" yn
case $yn in case $yn in
@ -48,7 +49,7 @@ install() {
*) echo "Please answer yes or no." ;; *) echo "Please answer yes or no." ;;
esac esac
done done
header_info
read -r -p "Verbose mode? <y/N> " prompt read -r -p "Verbose mode? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
STD="" STD=""
@ -66,12 +67,13 @@ install() {
msg_info "Installing Netdata" msg_info "Installing Netdata"
$STD apt-get update $STD apt-get update
$STD apt-get install -y netdata $STD apt-get install -y netdata
msg_ok "Installed Netdata\n" msg_ok "Installed Netdata"
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
echo -e "\n Netdata should be reachable at${BL} http://$(hostname -I | awk '{print $1}'):19999 ${CL}\n" echo -e "\n Netdata should be reachable at${BL} http://$(hostname -I | awk '{print $1}'):19999 ${CL}\n"
} }
uninstall() { uninstall() {
header_info
read -r -p "Verbose mode? <y/N> " prompt read -r -p "Verbose mode? <y/N> " prompt
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
STD="" STD=""
@ -88,7 +90,7 @@ uninstall() {
systemctl daemon-reload systemctl daemon-reload
$STD apt autoremove -y $STD apt autoremove -y
$STD userdel netdata $STD userdel netdata
msg_ok "Uninstalled Netdata\n" msg_ok "Uninstalled Netdata"
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
} }