Add Omada Controller setup script and update init.sh to include Omada option
This commit is contained in:
41
debian-13/apps/omada-controller/omada-controller.sh
Normal file
41
debian-13/apps/omada-controller/omada-controller.sh
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DEB_SOURCE=https://static.tp-link.com/upload/software/2026/202601/20260121/Omada_Network_Application_v6.1.0.19_linux_x64_20260117100106.deb
|
||||||
|
|
||||||
|
curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor
|
||||||
|
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install -y mongodb-org-server jsvc
|
||||||
|
|
||||||
|
cat > /usr/local/bin/omada-install << "EOF"
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "${1}" == "" ]; then
|
||||||
|
echo "Error: No download url provided."
|
||||||
|
echo "ex: omada-controller https://static.tp-link.com/upload/software/2026/202601/20260121/Omada_Network_Application_v6.1.0.19_linux_x64_20260117100106.deb"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEB_FILE=/opt/omada.deb
|
||||||
|
|
||||||
|
wget -O ${DEB_FILE} ${1}
|
||||||
|
dpkg --ignore-depends=jsvc -i ${DEB_FILE}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod 750 /usr/local/bin/omada-install
|
||||||
|
|
||||||
|
omada-install ${DEB_SOURCE}
|
||||||
|
|
||||||
|
if [ -f "/etc/iptables/rules.v4" ]; then
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 29811:29817 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p udp -m udp --dport 29810 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p udp -m udp --dport 27001 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p udp -m udp --dport 19810 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 9098 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 8843 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 8043 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 8088 -m state --state NEW -j ACCEPT' /etc/iptables/rules.v4
|
||||||
|
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a # Omada' /etc/iptables/rules.v4
|
||||||
|
iptables-restore /etc/iptables/rules.v4
|
||||||
|
fi
|
||||||
@@ -278,6 +278,7 @@ InstApps() {
|
|||||||
if [[ ${ISLXC} == 0 ]]; then
|
if [[ ${ISLXC} == 0 ]]; then
|
||||||
options+=("portainer" "" off)
|
options+=("portainer" "" off)
|
||||||
fi
|
fi
|
||||||
|
options+=("omada-controller" "" off)
|
||||||
options+=("misc-apps" "..." off)
|
options+=("misc-apps" "..." off)
|
||||||
options+=("archived-apps" "..." off)
|
options+=("archived-apps" "..." off)
|
||||||
SEL=$(whiptail --title "More Apps" --checklist "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
SEL=$(whiptail --title "More Apps" --checklist "" 0 0 0 "${options[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|||||||
Reference in New Issue
Block a user