v2.initial upload

This commit is contained in:
2026-07-25 10:18:31 -05:00
parent 3512472551
commit 7efe765854
4 changed files with 145 additions and 76 deletions
+66 -53
View File
@@ -2,16 +2,24 @@
# TA-Proxmenu - Proxmox Setup Scripts for TA Use
[ "${2}" != "q" ] && source /opt/idssys/defaults/colors.inc
[ "${2:-}" != "q" ] && source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc
source /opt/idssys/ta-proxmenu/defaults.inc
ACTION_REQUESTED=0
[[ -n "${action:-}" ]] && ACTION_REQUESTED=1
FINISH_ACTION() {
(( ACTION_REQUESTED == 1 )) && exit 0
ENTER2CONTINUE
}
INSTALL_PULSE() {
echo
bash <(curl -fsSL https://github.com/rcourtman/Pulse/releases/latest/download/install.sh)
echo
echo -e "\n${idsCL[Green]}Pulse has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
}
INSTALL_ACRONIS() {
@@ -20,14 +28,14 @@ INSTALL_ACRONIS() {
[Nn]) MAIN_MENU;;
* )
echo
cd /tmp
cd /tmp || return 1
wget "https://us5-cloud.acronis.com/bc/api/ams/links/agents/redirect?language=multi&channel=CURRENT&system=linux&architecture=64&productType=enterprise&login=010180ae-63c4-4495-bed0-4ec934c25af9&white_labeled=0" -O ./acronisinstall
chmod +x ./acronisinstall
./acronisinstall
rm -f ./acronisinstall
echo
echo -e "\n${idsCL[Green]}Acronis has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
;;
esac
}
@@ -42,14 +50,13 @@ INSTALL_PROXMENUX() {
# systemctl disable --now proxmenux-monitor
menu
# echo -e "\n${idsCL[Green]}ProxMenux has been installed${idsCL[Default]}"
# [ ${action-x} ] && exit 0 || ENTER2CONTINUE
# esac
}
PROXMENUX_POST_INSTALL() {
PMFLDR='/usr/local/share/proxmenux/scripts/post_install'
[ ! -f ${PMFLDR}/customizable_post_install.sh ] && INSTALL_PROXMENUX
bash ${PMFLDR}/customizable_post_install.sh
[ ! -f "${PMFLDR}/customizable_post_install.sh" ] && INSTALL_PROXMENUX
bash "${PMFLDR}/customizable_post_install.sh"
touch /opt/.PROXMENUX_POST_INSTALL
[ -s /etc/apt/sources.list ] && cat /dev/null > /etc/apt/sources.list
@@ -64,7 +71,7 @@ INSTALL_GLANCES() {
echo
apt install glances -y
echo -e "\n${idsCL[Green]}Glances has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
esac
}
@@ -75,7 +82,8 @@ INSTALL_SCREENCONNECT() {
* )
echo
echo -en "\n${idsCL[LightYellow]}Paste the URL provided from the Build Installer: ${idsCL[Default]}"
read -e SCURL
read -r -e SCURL
[[ -n "$SCURL" ]] || { echo "No URL supplied."; FINISH_ACTION; return; }
wget "${SCURL}" -O /tmp/scinstall
dpkg -i /tmp/scinstall
apt install --fix-broken -y
@@ -84,7 +92,7 @@ INSTALL_SCREENCONNECT() {
rm -f /tmp/scinstall
systemctl disable --now proxmenux-monitor
echo -e "\n${idsCL[Green]}ScreenConnect has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
esac
}
@@ -96,32 +104,41 @@ INSTALL_RMM() {
echo
echo -en "\n${idsCL[LightYellow]}Paste the Linux Server URL provided from the Download Agent screen: ${idsCL[Default]}"
read -e RMMURL
read -r -e RMMURL
[[ -n "$RMMURL" ]] || { echo "No URL supplied."; FINISH_ACTION; return; }
wget "${RMMURL}" -O /tmp/rmminstall
TOKEN="$(echo ${RMMURL} | awk -F 'TKN' '{print $2}' | awk -F '/RUN' '{print $1}')"
CMD="TOKEN=${TOKEN} bash /tmp/rmminstall"
eval ${CMD}
if [[ "$RMMURL" != *TKN* || "$RMMURL" != */RUN* ]]; then
echo "Unable to extract the RMM token from the URL."
FINISH_ACTION
return
fi
TOKEN="${RMMURL#*TKN}"
TOKEN="${TOKEN%%/RUN*}"
[[ -n "$TOKEN" ]] || { echo "The RMM token is empty."; FINISH_ACTION; return; }
TOKEN="$TOKEN" bash /tmp/rmminstall
systemctl restart ITSPlatform
# rm -f /tmp/rmminstall
echo -e "\n${idsCL[Green]}RMM has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
esac
}
INSTALL_S1() {
echo
echo -en "${idsCL[LightYellow]}Paste the customers SentinelOne Site Token: ${idsCL[Default]}"
read -e s1token
cd /tmp
wget "https://git.scity.us/TAI/files/raw/branch/main/SentinelAgent_linux_x86_64_v26_1_1_31.deb"
dpkg -i ./SentinelAgent_linux_x86_64*.deb
/opt/sentinelone/bin/sentinelctl management token set ${s1token}
read -r -e s1token
[[ -n "$s1token" ]] || { echo "No SentinelOne site token supplied."; FINISH_ACTION; return; }
cd /tmp || return 1
rm -f "/tmp/${S1_PACKAGE}"
wget "$S1_DOWNLOAD_URL" -O "/tmp/${S1_PACKAGE}"
dpkg -i "/tmp/${S1_PACKAGE}"
/opt/sentinelone/bin/sentinelctl management token set "$s1token"
/opt/sentinelone/bin/sentinelctl control start
rm -f ./SentinelAgent_linux_x86_64*.deb
rm -f "/tmp/${S1_PACKAGE}"
echo -e "\n${idsCL[Green]}SentinelOne Agent has been installed. Make sure its added to a \"DETECT ONLY\" policy${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
}
INSTALL_OMSA() {
@@ -130,8 +147,8 @@ INSTALL_OMSA() {
[Nn]) echo;;
* )
echo
mkdir /tmp/omsa
cd /tmp/omsa
mkdir -p /tmp/omsa
cd /tmp/omsa || return 1
apt install -y gnupg libcurl4t64 libncurses6 libxslt1.1 libgpm2 libtinfo6
mkdir -p /etc/apt/keyrings
wget -qO - https://linux.dell.com/repo/pgp_pubkeys/0x1285491434D8786F.asc | gpg --dearmor -o /etc/apt/keyrings/linux.dell.com.gpg
@@ -165,25 +182,25 @@ INSTALL_OMSA() {
dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb
apt install -y srvadmin-all
/opt/dell/srvadmin/sbin/srvadmin-services.sh start
rm -Rf /tmp/omsa
rm -rf -- /tmp/omsa
echo -e "\n${idsCL[Green]}Dell OMSA has been installed${idsCL[Default]}"
echo -e "\n${idsCL[LightCyan]}Available at: ${idsCL[LightGreen]}https://${RNIP}:1311${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
esac
}
DOWNLOAD_VIRTIO() {
echo -e "\n${idsCL[LightCyan]}Current \"Stable\" version available for download: ${idsCL[White]}${VIRTIO_FILE}${idsCL[Default]}"
if [ -f ${dldir}/${VIRTIO_FILE} ]; then
if [ -f "${DLDIR}/${VIRTIO_FILE}" ]; then
echo -en "\n${idsCL[LightRed]}Removing existing download ... "
rm -f ${DLDIR}/${VIRTIO_FILE}
rm -f "${DLDIR}/${VIRTIO_FILE}"
echo -e "${idsCL[Red]}Done${idsCL[Default]}"
fi
wget -q -F -P ${DLDIR} ${VIRTIO_DOWNLOAD_URL} &
wget -q -P "$DLDIR" "$VIRTIO_DOWNLOAD_URL" &
echo -e "\n${idsCL[LightCyan]}Downloading will continue in the background\n"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
}
DETECT_CPU(){
@@ -211,7 +228,7 @@ DETECT_CPU(){
sed -i "/cpu:/c cpu: $(proxclmc --list-only)" /etc/pve/nodes/*/qemu-server/*.conf
echo
echo -e "\n${idsCL[Green]}All VM's have been reconfigured\n${idsCL[LightCyan]}This will require the VM's to be powered off and then turned back on in order to take effect${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
;;
*) echo;;
esac
@@ -233,7 +250,7 @@ RESTART_PVE_SERVICES(){
systemctl restart pve-cluster pvedaemon pvestatd pveproxy
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo -e "\n${idsCL[Green]}This hosts Proxmox services have been restarted${idsCL[Default]}\n"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
;;
esac
}
@@ -250,7 +267,7 @@ SET_VM_SHUTDOWNTIMEOUT(){
*)
echo "Updating all VM's shutdown timeout to 180 seconds..."
sed -E -i 's/(down=)[0-9]+/\1180/g' /etc/pve/nodes/*/qemu-server/*.conf
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
;;
esac
}
@@ -272,7 +289,7 @@ MAINTENANCE_MODE(){
ha-manager crm-command node-maintenance enable $(hostname) &
echo -e "\n${idsCL[Green]}This host will be entered into maintenance mode${idsCL[Default]}\n"
fi
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
;;
esac
}
@@ -284,10 +301,10 @@ INSTALL_KEEPALIVE() {
* )
echo
source /opt/idssys/ta-proxmenu/inc/deploy-proxmox-keepalived.sh
bash /opt/idssys/ta-proxmenu/inc/deploy-proxmox-keepalived.sh
echo -e "\n${idsCL[Green]}Keepalive has been installed${idsCL[Default]}"
[ ${action-x} ] && exit 0 || ENTER2CONTINUE
FINISH_ACTION
esac
}
@@ -311,16 +328,16 @@ MAIN_MENU() {
echo
echo -en "${idsCL[White]} [${idsCL[LightYellow]}0${idsCL[Default]}] ${idsCL[White]}Run Post-Install Script${idsCL[Default]}"
[ -f /opt/.PROXMENUX_POST_INSTALL ] && echo -e "${idsCL[Cyan]} - Has been ran prevously${idsCL[Default]}" || echo
[ -f /opt/.PROXMENUX_POST_INSTALL ] && echo -e "${idsCL[Cyan]} - Has been run previously${idsCL[Default]}" || echo
echo -e "${idsCL[White]} [${idsCL[LightYellow]}1${idsCL[Default]}] ${idsCL[White]}Detect CPU-Arch for Live Migrations${idsCL[Default]}"
if ! echo ${CRES} | grep -i pulse &> /dev/null ; then
if ! grep -qi pulse <<< "$CRES"; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}2${idsCL[Default]}] ${idsCL[White]}Install Pulse Monitoring${idsCL[Default]}"
else
echo -e "${idsCL[DarkGray]} [2] Pulse Monitoring is already installed${idsCL[Default]}"
fi
if [ -f ${DLDIR}/${VIRTIO_FILE} ]; then
if [ -f "${DLDIR}/${VIRTIO_FILE}" ]; then
echo -e "${idsCL[DarkGray]} [3] Current VirtIO drivers already downloaded to 'local' on this host${idsCL[Default]}"
elif [ -f ${DLDIR}/virtio*.iso ]; then
elif compgen -G "${DLDIR}/virtio*.iso" > /dev/null; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}3${idsCL[Default]}] ${idsCL[LightGreen]}**${idsCL[White]}Download the available updated Win-VirtIO drivers to 'local' on this host${idsCL[Default]}"
else
echo -e "${idsCL[White]} [${idsCL[LightYellow]}3${idsCL[Default]}] ${idsCL[White]}Download the current Win-VirtIO drivers to 'local' on this host${idsCL[Default]}"
@@ -330,7 +347,7 @@ MAIN_MENU() {
else
echo -e "${idsCL[DarkGray]} [4] Glances is already installed${idsCL[Default]}"
fi
if [ "$(echo ${DPL} | awk '/srvadmin-all/ {print }'|wc -l)" -eq 0 ]; then
if ! grep -q 'srvadmin-all' <<< "$DPL"; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}5${idsCL[Default]}] ${idsCL[White]}Install Dell OpenManage Server Administrator${idsCL[Default]}"
else
echo -e "${idsCL[DarkGray]} [5] Dell OMSA is already installed - ${idsCL[Cyan]}https://${RNIP}:1311"
@@ -341,13 +358,13 @@ MAIN_MENU() {
else
echo -e "${idsCL[DarkGray]} [6] ConnectWise RMM Agent is already installed${idsCL[Default]}"
fi
if [ "$(echo ${DPL} | awk '/cyberprotect/ {print }'|wc -l)" -eq 0 ]; then
if ! grep -q 'cyberprotect' <<< "$DPL"; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}7${idsCL[Default]}] ${idsCL[White]}Install Acronis Backup Agent${idsCL[Default]}"
else
echo -e "${idsCL[DarkGray]} [7] Acronis Backup is already installed${idsCL[Default]}"
fi
if [ "$(echo ${DPL} | awk '/sentinelagent/ {print }'|wc -l)" -eq 0 ]; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}8${idsCL[Default]}] ${idsCL[White]}Install SentinelOne Agent (v25_4_2_21)${idsCL[Default]}"
if ! grep -q 'sentinelagent' <<< "$DPL"; then
echo -e "${idsCL[White]} [${idsCL[LightYellow]}8${idsCL[Default]}] ${idsCL[White]}Install SentinelOne Agent (v${S1_VERSION//_/.})${idsCL[Default]}"
else
echo -e "${idsCL[DarkGray]} [8] SentinelOne is already installed${idsCL[Default]}"
fi
@@ -389,14 +406,14 @@ MAIN_MENU() {
[Rr]) RESTART_PVE_SERVICES;;
[Kk]) INSTALL_KEEPALIVE;;
[Qq]) EXIT1; exit 0;;
*) echo -e "Thats an invaild option,\nplease select a valid option only."; sleep 1;;
*) echo -e "That's an invalid option.\nPlease select a valid option."; sleep 1;;
esac
done
}
if [ ${action-x} ]; then
case $action in
if (( ACTION_REQUESTED == 1 )); then
case "$action" in
pulse) INSTALL_PULSE;;
rmm) INSTALL_RMM;;
omsa) INSTALL_OMSA;;
@@ -404,10 +421,10 @@ if [ ${action-x} ]; then
acronis) INSTALL_ACRONIS;;
proxmenux) [ ! -f /usr/local/bin/menu ] && INSTALL_PROXMENUX || /usr/local/bin/menu;;
screenconnect) INSTALL_SCREENCONNECT;;
restart) RESTART_PVE_SERVICES ${2};;
restart) RESTART_PVE_SERVICES "${2:-}";;
cpu) DETECT_CPU;;
mm) MAINTENANCE_MODE;;
timeout) SET_VM_SHUTDOWNTIMEOUT ${2};;
timeout) SET_VM_SHUTDOWNTIMEOUT "${2:-}";;
*) MAIN_MENU;;
esac
else
@@ -416,7 +433,3 @@ fi
exit 0