Install Console Menu
This commit is contained in:
@@ -81,9 +81,9 @@ set_ttl(){
|
|||||||
# function to configure the fetures of simplefirewall
|
# function to configure the fetures of simplefirewall
|
||||||
simple_firewall_menu() {
|
simple_firewall_menu() {
|
||||||
if [ ! -f "$SIMPLE_FIREWALL_SCRIPT" ]; then
|
if [ ! -f "$SIMPLE_FIREWALL_SCRIPT" ]; then
|
||||||
echo -e "\033[0;31mSimplefirewall is not installed, would you like to install it?\033[0m"
|
display_random_color "Simplefirewall is not installed, would you like to install it?"
|
||||||
echo -e "\033[0;32m1) Yes\033[0m"
|
display_green "1) Yes"
|
||||||
echo -e "\033[0;31m2) No\033[0m"
|
display_red "2) No"
|
||||||
read -p "Enter your choice (1-2): " install_choice
|
read -p "Enter your choice (1-2): " install_choice
|
||||||
|
|
||||||
case $install_choice in
|
case $install_choice in
|
||||||
@@ -94,14 +94,15 @@ simple_firewall_menu() {
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\033[0;31mInvalid choice. Please select either 1 or 2.\033[0m"
|
display_red "Invalid choice. Please select either 1 or 2."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\e[1;32mConfigure Simple Firewall:\e[0m"
|
display_random_color "Configure Simple Firewall:"
|
||||||
echo -e "\e[38;5;208m1) Configure incoming port block\e[0m"
|
display_green "1) Configure incoming port block"
|
||||||
echo -e "\e[38;5;27m2) Configure TTL\e[0m"
|
display_green "2) Configure TTL"
|
||||||
|
display_green "3) Exit to Main Menu"
|
||||||
read -p "Enter your choice (1-2): " menu_choice
|
read -p "Enter your choice (1-2): " menu_choice
|
||||||
|
|
||||||
case $menu_choice in
|
case $menu_choice in
|
||||||
@@ -111,6 +112,9 @@ simple_firewall_menu() {
|
|||||||
2)
|
2)
|
||||||
set_ttl
|
set_ttl
|
||||||
;;
|
;;
|
||||||
|
3)
|
||||||
|
return
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\e[1;31mInvalid choice. Please select either 1 or 2.\e[0m"
|
echo -e "\e[1;31mInvalid choice. Please select either 1 or 2.\e[0m"
|
||||||
;;
|
;;
|
||||||
@@ -120,6 +124,6 @@ simple_firewall_menu() {
|
|||||||
echo -e "\e[1;32mFirewall configuration updated.\e[0m"
|
echo -e "\e[1;32mFirewall configuration updated.\e[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start by checking and installing xml if necessary, then mount filesystem as rw and run the menu
|
# Main execution
|
||||||
mount -o remount,rw /
|
mount -o remount,rw /
|
||||||
simple_firewall_menu
|
simple_firewall_menu
|
||||||
@@ -24,12 +24,12 @@ display_red() {
|
|||||||
|
|
||||||
toolkit_menu() {
|
toolkit_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
display_green "Run a Toolkit version"
|
display_random_color "Run a Toolkit version"
|
||||||
display_green "Select an option:"
|
display_green "Select an option:"
|
||||||
echo "------------------"
|
echo "------------------"
|
||||||
display_green "1. Get and run the Toolkit"
|
display_green "1. Get and run the Toolkit"
|
||||||
display_red "2. Get and run the Development/unstable Toolkit"
|
display_random_color "2. Get and run the Development/unstable Toolkit"
|
||||||
display_red "3. Exit (Enter Root Shell)"
|
display_random_color "3. Exit (Enter Root Shell)"
|
||||||
echo
|
echo
|
||||||
read -p "Select an option (1-11): " option
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ toolkit_menu() {
|
|||||||
|
|
||||||
apps_menu() {
|
apps_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
display_green "Run a modem App"
|
display_random_color "Run a modem App"
|
||||||
display_green "Select an option:"
|
display_green "Select an option:"
|
||||||
echo "------------------"
|
echo "------------------"
|
||||||
display_random_color "1. Open File Browser/Editor (mc)"
|
display_random_color "1. Open File Browser/Editor (mc)"
|
||||||
@@ -52,7 +52,7 @@ apps_menu() {
|
|||||||
display_random_color "3. Open Task Manager/View CPU Load"
|
display_random_color "3. Open Task Manager/View CPU Load"
|
||||||
display_random_color "4. Run speedtest.net test"
|
display_random_color "4. Run speedtest.net test"
|
||||||
display_random_color "5. Run fast.com test (30Mbps max)"
|
display_random_color "5. Run fast.com test (30Mbps max)"
|
||||||
display_red "6. Go Back"
|
display_green "6. Go Back"
|
||||||
echo
|
echo
|
||||||
read -p "Select an option (1-11): " option
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
@@ -70,10 +70,11 @@ apps_menu() {
|
|||||||
|
|
||||||
settings_menu() {
|
settings_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
display_green "Welcome to iamromulan's Simple Console Menu"
|
display_random_color "Welcome to" && display_green "iamromulan's" && display_random_color "Simple Console Menu"
|
||||||
display_green "Select an option:"
|
display_green "Select an option:"
|
||||||
echo "------------------"
|
echo "------------------"
|
||||||
display_green "1. LAN Settings"
|
display_green "1. LAN Settings"
|
||||||
|
display_green "2. simplefirewall settings (TTL and Port Block)"
|
||||||
display_green "2. Change simpleadmin (admin) password"
|
display_green "2. Change simpleadmin (admin) password"
|
||||||
display_green "3. Change root password (shell/ssh/console)"
|
display_green "3. Change root password (shell/ssh/console)"
|
||||||
display_green "4. Go back"
|
display_green "4. Go back"
|
||||||
@@ -82,9 +83,10 @@ settings_menu() {
|
|||||||
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
1) $MENU_SH/LAN_settings ;;
|
1) $MENU_SH/LAN_settings ;;
|
||||||
2) $EXE/simplepasswd ;;
|
3) simplepasswd ;;
|
||||||
3) passwd ;;
|
2) $MENU_SH/sfirewall_settings
|
||||||
4) break ;;
|
4) passwd ;;
|
||||||
|
5) break ;;
|
||||||
*) echo "Invalid option. Please try again." ;;
|
*) echo "Invalid option. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -141,6 +141,14 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
|||||||
cd $SIMPLE_ADMIN_DIR/script
|
cd $SIMPLE_ADMIN_DIR/script
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/ttl_script.sh
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/script/ttl_script.sh
|
||||||
sleep 1
|
sleep 1
|
||||||
|
cd $SIMPLE_ADMIN_DIR/console
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/.profile
|
||||||
|
sleep 1
|
||||||
|
cd $SIMPLE_ADMIN_DIR/console/menu
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/menu/start_menu.sh
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/menu/sfirewall_settings.sh
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/menu/start_menu.sh
|
||||||
|
sleep 1
|
||||||
cd $SIMPLE_ADMIN_DIR/www
|
cd $SIMPLE_ADMIN_DIR/www
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/favicon.ico
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/favicon.ico
|
||||||
@@ -173,6 +181,10 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
|||||||
cd /
|
cd /
|
||||||
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
|
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
|
||||||
chmod +x $SIMPLE_ADMIN_DIR/script/*
|
chmod +x $SIMPLE_ADMIN_DIR/script/*
|
||||||
|
chmod +x $SIMPLE_ADMIN_DIR/console/menu/*
|
||||||
|
chmod +x $SIMPLE_ADMIN_DIR/console/.profile
|
||||||
|
cp -f $SIMPLE_ADMIN_DIR/console/.profile /usrdata/root/.profile
|
||||||
|
chmod +x /usrdata/root/.profile
|
||||||
cp -rf $SIMPLE_ADMIN_DIR/systemd/* /lib/systemd/system
|
cp -rf $SIMPLE_ADMIN_DIR/systemd/* /lib/systemd/system
|
||||||
sleep 1
|
sleep 1
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
Reference in New Issue
Block a user