Progress...
This commit is contained in:
@@ -3,6 +3,14 @@
|
|||||||
CONFIG_FILE="/etc/data/mobileap_cfg.xml"
|
CONFIG_FILE="/etc/data/mobileap_cfg.xml"
|
||||||
|
|
||||||
# Display Messages in Colors
|
# Display Messages in Colors
|
||||||
|
display_random_color() {
|
||||||
|
local msg="$1"
|
||||||
|
local colors=(33 34 35 36 37) # ANSI color codes for yellow, blue, magenta, cyan, white
|
||||||
|
local num_colors=${#colors[@]}
|
||||||
|
local random_color_index=$(($RANDOM % num_colors)) # Pick a random index from the colors array
|
||||||
|
echo -e "\033[${colors[$random_color_index]}m$msg\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
display_green() {
|
display_green() {
|
||||||
echo -e "\033[0;32m$1\033[0m"
|
echo -e "\033[0;32m$1\033[0m"
|
||||||
}
|
}
|
||||||
156
simpleadmin/console/menu/start_menu.sh
Normal file
156
simpleadmin/console/menu/start_menu.sh
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Define executable files path
|
||||||
|
EXE=/usrdata/root/bin
|
||||||
|
|
||||||
|
# Display Messages in Colors
|
||||||
|
display_random_color() {
|
||||||
|
local msg="$1"
|
||||||
|
local colors=(33 34 35 36 37) # ANSI color codes for yellow, blue, magenta, cyan, white
|
||||||
|
local num_colors=${#colors[@]}
|
||||||
|
local random_color_index=$(($RANDOM % num_colors)) # Pick a random index from the colors array
|
||||||
|
echo -e "\033[${colors[$random_color_index]}m$msg\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
display_green() {
|
||||||
|
echo -e "\033[0;32m$1\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
display_red() {
|
||||||
|
echo -e "\033[0;31m$1\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Menus
|
||||||
|
|
||||||
|
toolkit() {
|
||||||
|
while true; do
|
||||||
|
display_green "Welcome to iamromulan's Simple Console Menu"
|
||||||
|
display_green "Select an option:"
|
||||||
|
echo "------------------"
|
||||||
|
display_green "1. LAN Settings"
|
||||||
|
display_green "2. Change simpleadmin (admin) password"
|
||||||
|
display_green "3. Change root password (shell/ssh/console)"
|
||||||
|
display_green "4. Open File Browser/Editor (mc)"
|
||||||
|
display_green "5. View Used/Available space"
|
||||||
|
display_green "6. Open Task Manager/View CPU Load"
|
||||||
|
display_green "7. Run speedtest.net test"
|
||||||
|
display_green "8. Run fast.com test (30Mbps max)"
|
||||||
|
display_green "9. Get and run the Toolkit"
|
||||||
|
display_green "10. Get and run the Development/unstable Toolkit"
|
||||||
|
display_green "11. Exit (Enter Root Shell)"
|
||||||
|
echo
|
||||||
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
|
case "$option" in
|
||||||
|
1) $EXE/LAN_settings ;;
|
||||||
|
2) $EXE/simplepasswd ;;
|
||||||
|
3) passwd ;;
|
||||||
|
4) mc ;;
|
||||||
|
5) dfc ;;
|
||||||
|
6) htop ;;
|
||||||
|
7) $EXE/speedtest ;;
|
||||||
|
8) $EXE/fast ;;
|
||||||
|
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
11) break ;;
|
||||||
|
*) echo "Invalid option. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
apps() {
|
||||||
|
while true; do
|
||||||
|
display_green "Welcome to iamromulan's Simple Console Menu"
|
||||||
|
display_green "Select an option:"
|
||||||
|
echo "------------------"
|
||||||
|
display_green "1. LAN Settings"
|
||||||
|
display_green "2. Change simpleadmin (admin) password"
|
||||||
|
display_green "3. Change root password (shell/ssh/console)"
|
||||||
|
display_green "4. Open File Browser/Editor (mc)"
|
||||||
|
display_green "5. View Used/Available space"
|
||||||
|
display_green "6. Open Task Manager/View CPU Load"
|
||||||
|
display_green "7. Run speedtest.net test"
|
||||||
|
display_green "8. Run fast.com test (30Mbps max)"
|
||||||
|
display_green "9. Get and run the Toolkit"
|
||||||
|
display_green "10. Get and run the Development/unstable Toolkit"
|
||||||
|
display_green "11. Exit (Enter Root Shell)"
|
||||||
|
echo
|
||||||
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
|
case "$option" in
|
||||||
|
1) $EXE/LAN_settings ;;
|
||||||
|
2) $EXE/simplepasswd ;;
|
||||||
|
3) passwd ;;
|
||||||
|
4) mc ;;
|
||||||
|
5) dfc ;;
|
||||||
|
6) htop ;;
|
||||||
|
7) $EXE/speedtest ;;
|
||||||
|
8) $EXE/fast ;;
|
||||||
|
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
11) break ;;
|
||||||
|
*) echo "Invalid option. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
settings() {
|
||||||
|
while true; do
|
||||||
|
display_green "Welcome to iamromulan's Simple Console Menu"
|
||||||
|
display_green "Select an option:"
|
||||||
|
echo "------------------"
|
||||||
|
display_green "1. LAN Settings"
|
||||||
|
display_green "2. Change simpleadmin (admin) password"
|
||||||
|
display_green "3. Change root password (shell/ssh/console)"
|
||||||
|
display_green "4. Open File Browser/Editor (mc)"
|
||||||
|
display_green "5. View Used/Available space"
|
||||||
|
display_green "6. Open Task Manager/View CPU Load"
|
||||||
|
display_green "7. Run speedtest.net test"
|
||||||
|
display_green "8. Run fast.com test (30Mbps max)"
|
||||||
|
display_green "9. Get and run the Toolkit"
|
||||||
|
display_green "10. Get and run the Development/unstable Toolkit"
|
||||||
|
display_green "11. Exit (Enter Root Shell)"
|
||||||
|
echo
|
||||||
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
|
case "$option" in
|
||||||
|
1) $EXE/LAN_settings ;;
|
||||||
|
2) $EXE/simplepasswd ;;
|
||||||
|
3) passwd ;;
|
||||||
|
4) mc ;;
|
||||||
|
5) dfc ;;
|
||||||
|
6) htop ;;
|
||||||
|
7) $EXE/speedtest ;;
|
||||||
|
8) $EXE/fast ;;
|
||||||
|
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
|
11) break ;;
|
||||||
|
*) echo "Invalid option. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
main_menu() {
|
||||||
|
while true; do
|
||||||
|
display_green "Welcome to iamromulan's Simple Console Menu"
|
||||||
|
display_green "To get back to this from the root shell, just type 'menu'"
|
||||||
|
display_green "Select an option:"
|
||||||
|
echo "------------------"
|
||||||
|
display_random_color "1) Apps"
|
||||||
|
display_random_color "2) Settings"
|
||||||
|
display_random_color "3) Toolkit"
|
||||||
|
display_random_color "4) Exit (Enter Root Shell)"
|
||||||
|
echo
|
||||||
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
|
case "$option" in
|
||||||
|
1) apps ;;
|
||||||
|
2) settings ;;
|
||||||
|
3) toolkit ;;
|
||||||
|
4) break ;;
|
||||||
|
*) echo "Invalid option. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
main_menu
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
DEVICE_FILE="/dev/smd7"
|
|
||||||
ICCID_FILE="/path/to/iccid_master_file" # Path to the ICCID-APN-IPType master file
|
|
||||||
TMP_DIR="/tmp"
|
|
||||||
TIMEOUT=4
|
|
||||||
|
|
||||||
# Start listening to device file
|
|
||||||
start_listening() {
|
|
||||||
cat "$DEVICE_FILE" > "$TMP_DIR/device_readout" &
|
|
||||||
CAT_PID=$!
|
|
||||||
}
|
|
||||||
|
|
||||||
# Send AT command
|
|
||||||
send_at_command() {
|
|
||||||
local command=$1
|
|
||||||
echo -e "${command}\r" > "$DEVICE_FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Wait for and process response
|
|
||||||
wait_for_response() {
|
|
||||||
local start_time=$(date +%s)
|
|
||||||
local current_time
|
|
||||||
local elapsed_time
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
if grep -q "OK" "$TMP_DIR/device_readout" || grep -q "ERROR" "$TMP_DIR/device_readout"; then
|
|
||||||
RESPONSE=$(cat "$TMP_DIR/device_readout")
|
|
||||||
echo "Response received: $RESPONSE"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
current_time=$(date +%s)
|
|
||||||
elapsed_time=$((current_time - start_time))
|
|
||||||
if [ "$elapsed_time" -ge "$TIMEOUT" ]; then
|
|
||||||
echo "Error: Response timed out."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Cleanup function
|
|
||||||
cleanup() {
|
|
||||||
kill "$CAT_PID"
|
|
||||||
wait "$CAT_PID" 2>/dev/null
|
|
||||||
rm -f "$TMP_DIR/device_readout"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to send AT command and wait for response
|
|
||||||
send_and_wait() {
|
|
||||||
send_at_command "$1"
|
|
||||||
wait_for_response
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to update the APN
|
|
||||||
update_apn() {
|
|
||||||
local slot=$1
|
|
||||||
local apn=$2
|
|
||||||
local iptype=$3
|
|
||||||
send_and_wait "AT+CGDCONT=$slot,\"$iptype\",\"$apn\""
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "APN updated successfully."
|
|
||||||
else
|
|
||||||
echo "Failed to update APN."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Main Execution
|
|
||||||
if [ -c "$DEVICE_FILE" ]; then
|
|
||||||
start_listening
|
|
||||||
|
|
||||||
# Get ICCID
|
|
||||||
send_and_wait "AT+CCID"
|
|
||||||
ICCID=$(echo "$RESPONSE" | grep "+CCID" | cut -d ':' -f2 | tr -d '[:space:]')
|
|
||||||
echo "ICCID: $ICCID"
|
|
||||||
|
|
||||||
# Check ICCID in master file
|
|
||||||
if grep -q "$ICCID" "$ICCID_FILE"; then
|
|
||||||
APN=$(grep "$ICCID" "$ICCID_FILE" | cut -d ',' -f2)
|
|
||||||
IP_TYPE=$(grep "$ICCID" "$ICCID_FILE" | cut -d ',' -f3)
|
|
||||||
IP_TYPE=${IP_TYPE:-"IPV4V6"} # Default to IPV4V6 if not specified
|
|
||||||
|
|
||||||
# Get current APN settings
|
|
||||||
send_and_wait "AT+CGDCONT?"
|
|
||||||
CURRENT_APN=$(echo "$RESPONSE" | grep "+CGDCONT: 1" | cut -d ',' -f3 | tr -d '"')
|
|
||||||
|
|
||||||
# Compare and update APN if necessary
|
|
||||||
if [ "$APN" != "$CURRENT_APN" ]; then
|
|
||||||
update_apn 1 "$APN" "$IP_TYPE"
|
|
||||||
else
|
|
||||||
echo "No APN update needed."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "ICCID not found in the master file."
|
|
||||||
fi
|
|
||||||
|
|
||||||
cleanup
|
|
||||||
else
|
|
||||||
echo "Error: Device $DEVICE_FILE does not exist or is not a character special file."
|
|
||||||
fi
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
edit_iccid_file() {
|
|
||||||
local iccid_file="/path/to/iccid_master_file" # Path to the ICCID-APN-IPType master file
|
|
||||||
|
|
||||||
echo "Enter ICCID to add or edit:"
|
|
||||||
read iccid
|
|
||||||
echo "Enter APN for $iccid:"
|
|
||||||
read apn
|
|
||||||
echo "Enter IP Type (IPV4, IPV6, IPV4V6) for $iccid [Default: IPV4V6]:"
|
|
||||||
read iptype
|
|
||||||
iptype=${iptype:-"IPV4V6"} # Default to IPV4V6 if not specified
|
|
||||||
|
|
||||||
# Check if ICCID already exists
|
|
||||||
if grep -q "$iccid" "$iccid_file"; then
|
|
||||||
# Update existing ICCID's APN and IP Type
|
|
||||||
sed -i "/$iccid/c\\$iccid,$apn,$iptype" "$iccid_file"
|
|
||||||
else
|
|
||||||
# Add new ICCID, APN, and IP Type
|
|
||||||
echo "$iccid,$apn,$iptype" >> "$iccid_file"
|
|
||||||
fi
|
|
||||||
echo "ICCID file updated."
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Define executable files path
|
|
||||||
EXE=/usrdata/root/bin
|
|
||||||
|
|
||||||
# Display Messages in Colors
|
|
||||||
display_green() {
|
|
||||||
echo -e "\033[0;32m$1\033[0m"
|
|
||||||
}
|
|
||||||
|
|
||||||
display_red() {
|
|
||||||
echo -e "\033[0;31m$1\033[0m"
|
|
||||||
}
|
|
||||||
|
|
||||||
main_menu() {
|
|
||||||
while true; do
|
|
||||||
display_green "Welcome to iamromulan's Simple Console Menu"
|
|
||||||
display_green "Select an option:"
|
|
||||||
echo "------------------"
|
|
||||||
display_green "1. QCMAP Settings"
|
|
||||||
display_green "2. Change simpleadmin (admin) password"
|
|
||||||
display_green "3. Change root password (shell/ssh/console)"
|
|
||||||
display_green "4. Open File Browser/Editor (mc)"
|
|
||||||
display_green "5. View Used/Available space"
|
|
||||||
display_green "6. Open Task Manager/View CPU Load"
|
|
||||||
display_green "7. Run speedtest.net test"
|
|
||||||
display_green "8. Run fast.com test (30Mbps max)"
|
|
||||||
display_green "9. Get and run the Toolkit"
|
|
||||||
display_green "10. Get and run the Development/unstable Toolkit"
|
|
||||||
display_green "11. Exit (Enter Root Shell)"
|
|
||||||
echo
|
|
||||||
read -p "Select an option (1-11): " option
|
|
||||||
|
|
||||||
case "$option" in
|
|
||||||
1) $EXE/ap_settings ;;
|
|
||||||
2) $EXE/simplepasswd ;;
|
|
||||||
3) passwd ;;
|
|
||||||
4) mc ;;
|
|
||||||
5) dfc ;;
|
|
||||||
6) htop ;;
|
|
||||||
7) $EXE/speedtest ;;
|
|
||||||
8) $EXE/fast ;;
|
|
||||||
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
11) break ;;
|
|
||||||
*) echo "Invalid option. Please try again." ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
main_menu
|
|
||||||
1
simpleupdates/.rev
Normal file
1
simpleupdates/.rev
Normal file
@@ -0,0 +1 @@
|
|||||||
|
2
|
||||||
@@ -172,7 +172,7 @@ install_ttyd() {
|
|||||||
echo -e "\e[1;34mStarting ttyd installation process...\e[0m"
|
echo -e "\e[1;34mStarting ttyd installation process...\e[0m"
|
||||||
cd $SIMPLE_ADMIN_DIR
|
cd $SIMPLE_ADMIN_DIR
|
||||||
wget -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.armhf && chmod +x ttyd
|
wget -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.armhf && chmod +x ttyd
|
||||||
wget -O $SIMPLE_ADMIN_DIR/scripts/ttyd.bash "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/scripts/ttyd.bash" && chmod +x scripts/ttyd.bash
|
wget -O $SIMPLE_ADMIN_DIR/scripts/ttyd.bash "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/console/ttyd.bash" && chmod +x scripts/ttyd.bash
|
||||||
wget -O $SIMPLE_ADMIN_DIR/systemd/ttyd.service "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/ttyd.service"
|
wget -O $SIMPLE_ADMIN_DIR/systemd/ttyd.service "https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/systemd/ttyd.service"
|
||||||
cp -f $SIMPLE_ADMIN_DIR/systemd/ttyd.service /lib/systemd/system/
|
cp -f $SIMPLE_ADMIN_DIR/systemd/ttyd.service /lib/systemd/system/
|
||||||
ln -sf /usrdata/simpleadmin/ttyd /bin
|
ln -sf /usrdata/simpleadmin/ttyd /bin
|
||||||
|
|||||||
Reference in New Issue
Block a user