This commit is contained in:
2023-07-17 22:09:53 -05:00
parent 89bef34600
commit 12fe7aca74

View File

@@ -3,7 +3,7 @@
action="$1"
FOLDER='/opt/idssys/linupx'
VERS='5.12-07162023'
VERS='5.14-07172023'
if [ -d /opt/idssys/settings ]; then
[ $(ls /opt/idssys/settings | wc -l) -eq 0 ] && rm -rf /opt/idssys/settings
@@ -79,7 +79,7 @@ UPDATE1() {
sudo apt-mark hold libopennms-java libopennmsdeps-java opennms-common opennms-db
fi
touch "${FOLDER}/lastrun"
echo ""
echo
echo -e "${Green}Updates have completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -107,7 +107,7 @@ UPDATE2() {
fi
touch "${FOLDER}/lastrun"
echo ""
echo
echo -e "${Green}Updated Upgrades have completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -146,7 +146,7 @@ UPDATE3() {
fi
fi
touch "${FOLDER}/lastrun"
echo ""
echo
echo -e "${Green}Updates have completed${Color_Off}"
if [ "$autorun_restart_after" = true ] || [ "$restart_flag" = true ]; then
echo -e "${BOrange}Rebooting now...${Color_Off}"
@@ -176,7 +176,7 @@ UPDATE4() {
fi
fi
touch "${FOLDER}/lastrun"
echo ""
echo
echo -e "${Green}Updates have completed${Color_Off}"
if [ "$autorun_restart_after" = true ] || [ "$restart_flag" = true ]; then
echo -e "${BOrange}Rebooting now...${Color_Off}"
@@ -194,7 +194,7 @@ DISTUPGRADE() {
if [ "$useAutoremove" -ne 0 ] && type apt-get &>/dev/null; then
AUTOREMOVE
fi
echo ""
echo
echo -e "${Green}Dist Upgrades has completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -211,14 +211,14 @@ PIPUPGRADE() {
python3 -m pip install --upgrade pip
pip3 list --outdated --format=json | jq -r '.[] | "\(.name)==\(.latest_version)"' | xargs -n1 pip3 install -U
fi
echo ""
echo
echo -e "${Green}Python-Pip Upgrades has completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
}
DNSUPDATE() {
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/branch/master/update-dns.sh)
echo ""
echo
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
}
@@ -241,7 +241,7 @@ DRYRUN1() {
elif type yum &>/dev/null; then
$APTFUNC check-update
fi
echo ""
echo
echo -e "${Green}Upgrade dry-run has completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -252,7 +252,7 @@ DRYRUN2() {
else
$APTFUNC dist-upgrade --dry-run
fi
echo ""
echo
echo -e "${Green}Dist-Upgrade dry-run has completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -297,9 +297,9 @@ WEBMIN_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-webmin.sh)
echo ""
echo
echo -e "${Green}Webmin has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -310,9 +310,9 @@ GLANCES_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-glances.sh)
echo ""
echo
echo -e "${Green}Glances has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -323,9 +323,9 @@ MYSQLBU_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-mysqlbu.sh)
echo ""
echo
echo -e "${Green}MySQL-BU has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -336,16 +336,16 @@ DSMON_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/branch/master/install-dsmon.sh)
echo ""
echo
echo -e "${Green}DSMon has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
esac
}
REMOVEFLOPPY() {
echo ""
echo
if [ ! -f /etc/modprobe.d/blacklist-floppy.conf ]; then
echo "blacklist floppy" | sudo tee /etc/modprobe.d/blacklist-floppy.conf
sudo rmmod floppy
@@ -396,9 +396,9 @@ NETDATA_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
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
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";;
@@ -485,7 +485,7 @@ IPERF_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
cd /tmp
wget https://downloads.es.net/pub/iperf/iperf-3.10.1.tar.gz
@@ -496,7 +496,7 @@ IPERF_INSTALL() {
make install
ldconfig
echo ""
echo
echo -e "${Green}iPerf has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -507,7 +507,7 @@ CHANGECOPYCERTS_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
ssh-copy-id le@keepalived.scity.us
echo
@@ -515,7 +515,7 @@ CHANGECOPYCERTS_INSTALL() {
sed -i 's/scp -pr le@webserver.scity.us:\/etc\/letsencrypt\/live/scp -pr le@keepalived.scity.us:\/opt\/nginx-proxy\/ssl/' /opt/copycerts.sh
/opt/copycerts.sh
echo ""
echo
echo -e "${Green}copycerts.sh has been updated${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -526,7 +526,7 @@ SPEEDTEST_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
$APTFUNC remove -y -qq speedtest speedtest-cli >/dev/null 2&>1
pip uninstall speedtest speedtest-cli -y >/dev/null 2&>1
@@ -534,9 +534,9 @@ SPEEDTEST_INSTALL() {
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
$APTFUNC install -y speedtest
echo ""
echo
echo -e "${Green}SpeedTest has been Installed${Color_Off}"
echo ""
echo
echo -e "${LightCyan}To run, use the command: speedtest${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -547,10 +547,10 @@ URBACKUP_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
read -p "Enter ClientID:" clientid
echo ""
echo
read -p "Enter Auth Key:" authkey
TF=`mktemp`
@@ -558,9 +558,9 @@ URBACKUP_INSTALL() {
sudo sh $TF
rm -f $TF
echo ""
echo
echo -e "${Green}UrBackup Client has been Installed${Color_Off}"
echo ""
echo
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
esac
@@ -570,9 +570,9 @@ X11VNC_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-vnc.sh)
echo ""
echo
echo -e "${Green}x11vnc has been Installed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
@@ -583,7 +583,7 @@ LINUPX_UNINSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/uninstall-linupx.sh)
exit 0;;
esac
@@ -593,7 +593,7 @@ FW_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-filewatcher.sh)
exit 0;;
esac
@@ -603,9 +603,9 @@ DSMON_INSTALL() {
case "$choice" in
[Nn]) INSTALL_MENU;;
* )
echo ""
echo
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-dsmon.sh)
echo ""
echo
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue";;
esac
@@ -615,7 +615,7 @@ ENABLE_REMOTESYSLOG(){
case "$choice" in
[Nn]) SCRIPT_MENU;;
* )
echo ""
echo
echo -e "\n\n*.* @${RemoteSyslogServer}:514" >> /etc/rsyslog.d/50-default.conf
service rsyslog restart
SCRIPT_MENU;;
@@ -632,7 +632,7 @@ PYTHON3UPGRADE(){
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
update-alternatives --config python3
echo ""
echo
echo -e "${Green}Python3.10 Upgrade has been Completed${Color_Off}"
if [ ${action-x} ]; then exit 0; fi
read -n 1 -s -p "Press any key to continue"
@@ -641,7 +641,7 @@ PYTHON3UPGRADE(){
}
POSTFIX_INSTALL(){
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/master/install-postfix.sh)
echo ""
echo
read -n 1 -s -p "Press any key to continue"
INSTALL_MENU
}
@@ -665,7 +665,7 @@ blacklist {
ADDVEEAMUSER(){
bash <(curl -sL https://git.schroedercity.com/voltron/Misc-Scripts/raw/branch/master/add-veeam-user.sh)
echo ""
echo
}
COPYCERTS_UPDATE(){
@@ -674,7 +674,7 @@ COPYCERTS_UPDATE(){
/bin/sed -i 's/le@keepalived.scity.us\:\/opt\/nginx-proxy\/ssl/le@keepalived.scity.us\:\/opt\/lb-data\/letsencrypt\/live/g' /opt/copycerts.sh
/opt/copycerts.sh
echo ""
echo
echo -e "${Green}copycerts.sh has been updated${Color_Off}"
else
echo -e "${Blue}copycerts.sh not found${Color_Off}"
@@ -811,12 +811,12 @@ SCRIPT_MENU() {
while :
do
clear
echo ""
echo
echo -e " ${LGreen}LinUPx - L I N U X U P D A T E S C R I P T S${Color_Off} ${DGray}(ver-${VERS})${Color_Off}"
echo -e "${LGreen}---------------------------------------------------------------------------${Color_Off}"
echo -e "Hostname: ${BBlue}$(hostname -s)${Color_Off}"
echo -e "Domain: ${BBlue}$(hostname -d)${Color_Off}"
echo ""
echo
echo -e "Updates last run on: ${Green}${LASTRUND} ${LASTRUNT}${Color_Off}"
echo "---------------------------------------------------------------------------"
OS=($(detect_os))
@@ -827,7 +827,7 @@ SCRIPT_MENU() {
printf "%-${width}s: %s\n" "Version" "${OS[3]}"
printf "%-${width}s: %s\n" "Codename/Rev" "${OS[4]}"
echo -e "${LGreen}---------------------------------------------------------------------------${Color_Off}"
echo ""
echo
echo " [1] Check for Updates/Upgrades"
echo "*[2] Run Updates"
if [ "$ATYPE" != 'yum' ]; then
@@ -842,33 +842,33 @@ SCRIPT_MENU() {
echo " [8] Fix multipath/vmware issue"
echo
if [ "$(IP_ALLOWED `hostname -I`)" == "true" ]; then
echo " [U] Update copycerts.sh SSL server"
echo " [D] Update DNS (10.10.10.10, 10.10.10.11)"
echo " [C] Change copycerts to LB-Nodes"
echo " [P] Upgrade to Python v3"
# echo " [U] Update copycerts.sh SSL server"
# echo " [D] Update DNS (10.10.10.10, 10.10.10.11)"
# echo " [C] Change copycerts to LB-Nodes"
# echo " [P] Upgrade to Python v3"
echo " [V] Add Veeam User Account"
echo
fi
if [ "$ATYPE" != 'yum' ]; then
echo " [0] Enable/Disable Automatic Security Updates"
echo ""
echo
fi
echo " [I] Installation Scripts"
echo " [K] Update/Fix Missing APT Repo Keys"
echo " [N] Reconfigure Network"
echo ""
echo
# echo " [L] Enable Remote Syslog"
# echo " [Config file: RemoteSyslogServer=${RemoteSyslogServer}]"
# echo ""
# echo
echo " [R] Reboot System"
echo " [S] Shutdown System"
echo " [Q] Quit"
echo ""
echo ""
echo
echo
echo -e -n "${BOrange}Please select an [ActionItem] from above:${Color_Off} "
read -n 1 opt
echo ""
echo
case $opt in
1) DRYRUN1
SCRIPT_MENU;;
@@ -885,7 +885,7 @@ SCRIPT_MENU() {
7) REMOVEFLOPPY
SCRIPT_MENU;;
8) MPVMFIX
echo ""
echo
read -n 1 -s -p "Press any key to continue"
SCRIPT_MENU;;
0) ENDISASU
@@ -924,14 +924,14 @@ INSTALL_MENU() {
while :
do
clear
echo ""
echo
echo -e " ${LGreen}LinUPx - L I N U X U P D A T E S C R I P T S${Color_Off} ${DGray}(ver-${VERS})${Color_Off}"
echo -e " ${Green}INSTALLATION SCRIPTS${Color_Off}"
echo -e "${LGreen}---------------------------------------------------------------------------${Color_Off}"
echo -e "Hostname: ${BBlue}$(hostname -s)${Color_Off}"
echo -e "Domain: ${BBlue}$(hostname -d)${Color_Off}"
echo -e "${LGreen}---------------------------------------------------------------------------${Color_Off}"
echo ""
echo
echo " [1] Webmin"
echo " [2] Glances"
echo " [3] x11vnc"
@@ -940,22 +940,22 @@ INSTALL_MENU() {
echo " [6] DSMon"
echo " [7] iPerf v3.10.1"
echo " [8] Speedtest.net"
echo ""
echo
echo " [D] Install DSMon"
echo " [N] Install Netdata Agent"
echo " [P] Install Postfix"
echo " [U] Install UrBackup Client"
echo ""
echo
echo " [9] Install .bashrc for root"
echo " [0] Remove LinUPx"
echo ""
echo
echo " [B] Back to Update Scripts"
echo " [Q] Quit"
echo ""
echo ""
echo
echo
echo -e -n "${BOrange}Please select an [ActionItem] from above:${Color_Off} "
read -n 1 opt
echo ""
echo
case $opt in
1) WEBMIN_INSTALL
INSTALL_MENU;;