From 1b5bba30ac2b5f05ce98d98118cc7038adcefb3c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 5 Nov 2022 11:04:35 -0500 Subject: [PATCH] Update linupx-scripts.sh --- linupx-scripts.sh | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/linupx-scripts.sh b/linupx-scripts.sh index fb9bced..6a80892 100755 --- a/linupx-scripts.sh +++ b/linupx-scripts.sh @@ -353,17 +353,35 @@ DSMON_INSTALL() { esac } NETDATA_INSTALL() { - read -n 1 -p "Are you sure you wish to install Netdata Agent (Y/n)?" choice - case "$choice" in - [Nn]) INSTALL_MENU;; - * ) - echo "" - wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --claim-token GKUQidqs3HAdWdyLgYjjHpI6k0W09TPxv4hyEvESuNKF9Xy0SKBvOr7BokNZHn6j7GUHlfc_R8UQp-dEXPAoRHdEmbSRCGOXX4XiOfMRazUk6Dd_3qjIdqJu9YqDaL2jw1hSTzw --claim-url https://app.netdata.cloud - echo "" - echo -e "${Green}Netdata Agent has been Installed${Color_Off}" - if [ ${action-x} ]; then exit 0; fi - read -n 1 -s -p "Press any key to continue";; - esac + if service_exists systemd-networkd; then + + read -n 1 -p "Netdata is already installed, would you like to remove it (y/N)?" choice + case "$choice" in + [Yy]) + echo "" + wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall + echo "" + echo -e "${Green}Netdata Agent has been Removed${Color_Off}" + if [ ${action-x} ]; then exit 0; fi + read -n 1 -s -p "Press any key to continue";; + * ) INSTALL_MENU;; + esac + + else + + read -n 1 -p "Are you sure you wish to install Netdata Agent (Y/n)?" choice + case "$choice" in + [Nn]) INSTALL_MENU;; + * ) + echo "" + wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh && sh /tmp/netdata-kickstart.sh --claim-token GKUQidqs3HAdWdyLgYjjHpI6k0W09TPxv4hyEvESuNKF9Xy0SKBvOr7BokNZHn6j7GUHlfc_R8UQp-dEXPAoRHdEmbSRCGOXX4XiOfMRazUk6Dd_3qjIdqJu9YqDaL2jw1hSTzw --claim-url https://app.netdata.cloud + echo "" + echo -e "${Green}Netdata Agent has been Installed${Color_Off}" + if [ ${action-x} ]; then exit 0; fi + read -n 1 -s -p "Press any key to continue";; + esac + + fi } IPERF_INSTALL() { read -n 1 -p "Are you sure you wish to install iPerf (Y/n)?" choice