@@ -9,206 +9,124 @@ CYAN='\033[38;5;51m' # Cyan
99MAGENTA=' \033[38;5;171m' # Magenta
1010NC=' \033[0m' # No Color
1111
12- while true ; do
13- clear
14- echo -e " ${CYAN} +======================================================================+${NC} "
15- echo -e " ${CYAN} ║ ${RED} ▌║█║▌║▌│║▌║▌█║ NetOptix Coded By MrAmini ▌│║▌║▌║║▌█║${NC} ${CYAN} ║${NC} "
16- echo -e " ${CYAN} +======================================================================+${NC} "
17- echo -e " ${CYAN} +======================================================================+${NC} "
18- echo -e " ${CYAN} ║ ${RED} ▌║█║▌│║│║▌║▌█║ Main Menu ▌│║▌║│║║▌█║▌${NC} ${CYAN} ║${NC} "
19- echo -e " ${CYAN} +======================================================================+${NC} "
20- echo -e " ${CYAN} +======================================================================+${NC} "
21- echo -e " ${RED} Open issues at https://github.com/MrAminiDev/NetOptix ${NC} "
22- echo -e " ${CYAN} +======================================================================+${NC} "
23- echo -e " ${CYAN} +======================================================================+${NC} "
24- echo -e " ${RED} NetOptix V3.4.0 ${NC} "
25- echo -e " ${CYAN} +======================================================================+${NC} "
26-
27- # Network Optimization (Green)
28- echo -e " \n${GREEN} == Network Optimization ==${NC} "
29- echo -e " ${GREEN} 1${NC} ) ${YELLOW} Install Hybla${NC} "
30- echo -e " ${GREEN} 2${NC} ) ${YELLOW} Install BBR${NC} "
31- echo -e " ${GREEN} 3${NC} ) ${YELLOW} Delete Optimize (BBR and Hybla)${NC} "
32- echo -e " ${GREEN} 4${NC} ) ${YELLOW} Create Swap${NC} "
33- echo -e " ${GREEN} 5${NC} ) ${YELLOW} Create ZRAM${NC} "
34- echo -e " ${GREEN} 6${NC} ) ${YELLOW} MTU Finder + Auto Set${NC} "
35- echo -e " ${GREEN} 7${NC} ) ${YELLOW} MTU Finder${NC} "
12+ # Functions for Submenus
13+ network_optimization_menu () {
14+ while true ; do
15+ clear
16+ echo -e " ${GREEN} == Network Optimization ==${NC} "
17+ echo -e " 1) Install Hybla"
18+ echo -e " 2) Install BBR"
19+ echo -e " 3) Delete Optimize (BBR and Hybla)"
20+ echo -e " 4) Create Swap"
21+ echo -e " 5) Create ZRAM"
22+ echo -e " 6) MTU Finder + Auto Set"
23+ echo -e " 7) MTU Finder"
24+ echo -e " 0) Back to Main Menu"
25+ read -p " Enter your choice: " choice
26+ case $choice in
27+ 1) echo " Running Hybla script..." ;;
28+ 2) echo " Running BBR script..." ;;
29+ 3) echo " Running Uninstall script..." ;;
30+ 4) echo " Running Swap script..." ;;
31+ 5) echo " Running ZRAM script..." ;;
32+ 6) echo " Running MTU Finder + Auto Set script..." ;;
33+ 7) echo " Running MTU Finder script..." ;;
34+ 0) return ;;
35+ * ) echo " Invalid choice." ; sleep 2 ;;
36+ esac
37+ done
38+ }
3639
37- # Server & Network Management (Blue)
38- echo -e " \n${BLUE} == Server & Network Management ==${NC} "
39- echo -e " ${BLUE} 8${NC} ) ${CYAN} Block and Unblock Server Ping${NC} "
40- echo -e " ${BLUE} 9${NC} ) ${CYAN} Block Torrent List${NC} "
41- echo -e " ${BLUE} 10${NC} ) ${CYAN} Change Server DNS${NC} "
42- echo -e " ${BLUE} 11${NC} ) ${CYAN} Change SSH Port${NC} "
43- echo -e " ${BLUE} 12${NC} ) ${CYAN} Block and Unblock Private Network${NC} "
44- echo -e " ${BLUE} 13${NC} ) ${CYAN} Block and Unblock Iranian ISP${NC} "
45- echo -e " ${BLUE} 14${NC} ) ${CYAN} Install mikrotik on ubuntu${NC} "
46- echo -e " ${BLUE} 15${NC} ) ${CYAN} Install Monitoring system (Cockpit)${NC} "
47-
48- # Security (Red)
49- echo -e " \n${RED} == Security ==${NC} "
50- echo -e " ${RED} 16${NC} ) ${CYAN} Install Fail2ban for SSH Security${NC} "
51- echo -e " ${RED} 17${NC} ) ${CYAN} Block and Unblock All SpeedTest Websites${NC} "
40+ server_management_menu () {
41+ while true ; do
42+ clear
43+ echo -e " ${BLUE} == Server & Network Management ==${NC} "
44+ echo -e " 1) Block and Unblock Server Ping"
45+ echo -e " 2) Block Torrent List"
46+ echo -e " 3) Change Server DNS"
47+ echo -e " 4) Change SSH Port"
48+ echo -e " 5) Block and Unblock Private Network"
49+ echo -e " 6) Block and Unblock Iranian ISP"
50+ echo -e " 7) Install mikrotik on Ubuntu"
51+ echo -e " 8) Install Monitoring System (Cockpit)"
52+ echo -e " 0) Back to Main Menu"
53+ read -p " Enter your choice: " choice
54+ case $choice in
55+ 1) echo " Running Server Ping Blocker..." ;;
56+ 2) echo " Running Block Torrent List..." ;;
57+ 3) echo " Running Server DNS Changer..." ;;
58+ 4) echo " Running SSH Port Changer..." ;;
59+ 5) echo " Running Private Network Blocker..." ;;
60+ 6) echo " Running Iranian ISP Blocker..." ;;
61+ 7) echo " Running Mikrotik Installer..." ;;
62+ 8) echo " Installing Monitoring System..." ;;
63+ 0) return ;;
64+ * ) echo " Invalid choice." ; sleep 2 ;;
65+ esac
66+ done
67+ }
5268
53- # System Maintenance (Magenta)
54- echo -e " \n${MAGENTA} == System Maintenance ==${NC} "
55- echo -e " ${MAGENTA} 18${NC} ) ${CYAN} Fix WhatsApp Data and Time${NC} "
56- echo -e " ${MAGENTA} 19${NC} ) ${CYAN} Disable IPv6${NC} "
69+ security_menu () {
70+ while true ; do
71+ clear
72+ echo -e " ${RED} == Security ==${NC} "
73+ echo -e " 1) Install Fail2ban for SSH Security"
74+ echo -e " 2) Block and Unblock All SpeedTest Websites"
75+ echo -e " 0) Back to Main Menu"
76+ read -p " Enter your choice: " choice
77+ case $choice in
78+ 1) echo " Installing Fail2ban..." ;;
79+ 2) echo " Running SpeedTest Blocker..." ;;
80+ 0) return ;;
81+ * ) echo " Invalid choice." ; sleep 2 ;;
82+ esac
83+ done
84+ }
5785
58- # Exit Option (Yellow)
59- echo -e " \n${YELLOW} == Exit ==${NC} "
60- echo -e " ${YELLOW} 20${NC} ) ${CYAN} Exit Menu${NC} "
86+ system_maintenance_menu () {
87+ while true ; do
88+ clear
89+ echo -e " ${MAGENTA} == System Maintenance ==${NC} "
90+ echo -e " 1) Fix WhatsApp Data and Time"
91+ echo -e " 2) Disable IPv6"
92+ echo -e " 0) Back to Main Menu"
93+ read -p " Enter your choice: " choice
94+ case $choice in
95+ 1) echo " Fixing WhatsApp Data and Time..." ;;
96+ 2) echo " Disabling IPv6..." ;;
97+ 0) return ;;
98+ * ) echo " Invalid choice." ; sleep 2 ;;
99+ esac
100+ done
101+ }
61102
62- read -p " Enter your choice: " choice
63-
64- case $choice in
65- 1)
66- echo " Running Hybla script..."
67- sleep 2
68- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/hybla.sh -o /tmp/hybla.sh
69- bash /tmp/hybla.sh
70- rm /tmp/hybla.sh
71- ;;
72- 2)
73- echo " Running BBR script..."
74- sleep 2
75- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/bbr.sh -o /tmp/bbr.sh
76- bash /tmp/bbr.sh
77- rm /tmp/bbr.sh
78- ;;
79- 3)
80- echo " Running Uninstall script..."
81- sleep 2
82- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/uninstall.sh -o /tmp/uninstall.sh
83- bash /tmp/uninstall.sh
84- rm /tmp/uninstall.sh
85- ;;
86- 4)
87- echo " Running Swap script..."
88- sleep 2
89- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/swap.sh -o /tmp/swap.sh
90- bash /tmp/swap.sh
91- rm /tmp/swap.sh
92- ;;
93- 5)
94- echo " Running Swap script..."
95- sleep 2
96- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/swap.sh -o /tmp/swap.sh
97- bash /tmp/swap.sh
98- rm /tmp/swap.sh
99- ;;
100- 6)
101- echo " Running MTU finder + auto set script..."
102- sleep 2
103- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/mtu.sh -o /tmp/mtu.sh
104- bash /tmp/mtu.sh
105- rm /tmp/mtu.sh
106- ;;
107- 7)
108- echo " Running MTU finder script..."
109- sleep 2
110- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/mtunoset.sh -o /tmp/mtunoset.sh
111- bash /tmp/mtunoset.sh
112- rm /tmp/mtunoset.sh
113- ;;
114- 8)
115- echo " Running Server Ping Blocker..."
116- sleep 2
117- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/Ping.sh -o /tmp/Ping.sh
118- bash /tmp/Ping.sh
119- rm /tmp/Ping.sh
120- ;;
121- 9)
122- echo " Running Block torrent list..."
123- sleep 2
124- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/blocktorrent/blocktorrent.sh -o /tmp/blocktorrent.sh
125- bash /tmp/blocktorrent.sh
126- rm /tmp/blocktorrent.sh
127- ;;
128- 10)
129- echo " Running Server DNS changer..."
130- sleep 2
131- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/dns.sh -o /tmp/dns.sh
132- bash /tmp/dns.sh
133- rm /tmp/dns.sh
134- ;;
135- 11)
136- echo " Running SSH port changer..."
137- sleep 2
138- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/cport.sh -o /tmp/cport.sh
139- bash /tmp/cport.sh
140- rm /tmp/cport.sh
141- ;;
142- 12)
143- echo " Running Private network blocker and unblocker..."
144- sleep 2
145- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/pib.sh -o /tmp/pib.sh
146- bash /tmp/pib.sh
147- rm /tmp/pib.sh
148- ;;
149- 13)
150- echo " Running Iran ISP blocker and unblocker..."
151- sleep 2
152- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/isp-blocker/block-isp.sh -o /tmp/block-isp.sh
153- bash /tmp/block-isp.sh
154- rm /tmp/block-isp.sh
155- ;;
156- 14)
157- echo " Running mikrotik installer on ubuntu..."
158- sleep 2
159- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/mikrotik.sh -o /tmp/mikrotik.sh
160- bash /tmp/mikrotik.sh
161- rm /tmp/mikrotik.sh
162- ;;
163- 15)
164- echo " Install Monitoring system (Cockpit)"
165- sleep 2
166- sudo apt update
167- sudo apt install cockpit
168- sudo systemctl start cockpit
169- sleep 2
170- echo " Done, Monitoring system Onlined... use IP:9090 (user: root / password: server password)"
171- sleep 10
172- ;;
173- 16)
174- echo " Running installer fail2ban script for ssh security..."
175- sleep 2
176- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/fail2ban.sh -o /tmp/fail2ban.sh
177- bash /tmp/fail2ban.sh
178- rm /tmp/fail2ban.sh
179- ;;
180- 17)
181- echo " Running Speedtest blocker and unblocker..."
182- sleep 2
183- curl -fsSL https://raw.githubusercontent.com/MrAminiDev/NetOptix/main/scripts/speedtest/speedtest.sh -o /tmp/speedtest.sh
184- bash /tmp/speedtest.sh
185- rm /tmp/speedtest.sh
186- ;;
187- 18)
188- echo " Running WhatsApp Data and Time fixer..."
189- sleep 2
190- sudo timedatectl set-timezone Asia/Tehran
191- sleep 2
192- echo " Done, WhatsApp Data and Time fixed..."
193- sleep 3
194- ;;
195- 19)
196- echo " Running IPv6 Disabling command..."
197- sleep 2
198- sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
199- sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
200- sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
201- echo " Done, IPv6 Disabled..."
202- sleep 3
203- ;;
204- 20)
205- echo " Exiting..."
206- sleep 3
207- exit 0
208- ;;
209- * )
210- echo " Invalid choice. Please enter a valid option."
211- read -p " Press Enter to continue..."
212- ;;
103+ # Main Menu
104+ while true ; do
105+ clear
106+ echo -e " ${CYAN} +======================================================================+${NC} "
107+ echo -e " ${RED} ## ## ######## ######## ####### ######## ######## #### ## ## ${NC} "
108+ echo -e " ${RED} ### ## ## ## ## ## ## ## ## ## ## ## ${NC} "
109+ echo -e " ${RED} #### ## ## ## ## ## ## ## ## ## ## ## ${NC} "
110+ echo -e " ${RED} ## ## ## ###### ## ## ## ######## ## ## ### ${NC} "
111+ echo -e " ${RED} ## #### ## ## ## ## ## ## ## ## ## ${NC} "
112+ echo -e " ${RED} ## ### ## ## ## ## ## ## ## ## ## ${NC} "
113+ echo -e " ${RED} ## ## ######## ## ####### ## ## #### ## ## ${NC} "
114+ echo -e " ${CYAN} +======================================================================+${NC} "
115+ echo -e " | Telegram Channel : ${MAGENTA} @AminiDev ${NC} | Version : ${GREEN} 4.0.0${NC} "
116+ echo -e " ${CYAN} +======================================================================+${NC} "
117+ echo -e " ${CYAN} == Main Menu ==${NC} "
118+ echo -e " 1) Network Optimization"
119+ echo -e " 2) Server & Network Management"
120+ echo -e " 3) Security"
121+ echo -e " 4) System Maintenance"
122+ echo -e " 5) Exit"
123+ read -p " Enter your choice: " main_choice
124+ case $main_choice in
125+ 1) network_optimization_menu ;;
126+ 2) server_management_menu ;;
127+ 3) security_menu ;;
128+ 4) system_maintenance_menu ;;
129+ 5) echo " Exiting..." ; exit 0 ;;
130+ * ) echo " Invalid choice." ; sleep 2 ;;
213131 esac
214132done
0 commit comments