Skip to content

Instantly share code, notes, and snippets.

@RobSeder
Last active April 29, 2024 03:33
Show Gist options
  • Save RobSeder/48918a966117a34a2aa19619253d4aae to your computer and use it in GitHub Desktop.
Save RobSeder/48918a966117a34a2aa19619253d4aae to your computer and use it in GitHub Desktop.
In ProxMox, when you change your APT repo from enterprise.proxmox.com pve-enterprise to download.proxmox.com pve-no-subscription, the UI shows a "warning" message about not using the enterprise version. This removes that popup.
#!/bin/bash
# Set color codes
INFO='\033[1;36m' # Cyan
SUCCESS='\033[1;32m' # Green
ERROR='\033[1;31m' # Red
NC='\033[0m' # No Color
echo -e "${INFO}[*] Changing directory to /usr/share/javascript/proxmox-widget-toolkit/${NC}"
cd /usr/share/javascript/proxmox-widget-toolkit/ || { echo -e "${ERROR}[-] Error: Failed to change directory${NC}"; exit 1; }
echo -e "${INFO}[*] Creating a backup of proxmoxlib.js${NC}"
cp proxmoxlib.js proxmoxlib.js.bak || { echo -e "${ERROR}[-] Error: Failed to create backup${NC}"; exit 1; }
echo -e "${INFO}[*] Modifying proxmoxlib.js${NC}"
sed -i.bak 's/Ext.Msg.show({/void({/g' proxmoxlib.js || { echo -e "${ERROR}[-] Error: Failed to modify file${NC}"; exit 1; }
echo -e "${INFO}[*] Restarting pveproxy service${NC}"
systemctl restart pveproxy.service || { echo -e "${ERROR}[-] Error: Failed to restart service${NC}"; exit 1; }
echo -e "${INFO}[*] Checking if banner was successfully removed${NC}"
if grep -q 'No valid sub' proxmoxlib.js; then
echo -e "${SUCCESS}[+] Success: Banner successfully removed.${NC}"
else
echo -e "${ERROR}[-] Error: Banner not removed.${NC}"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment