Compare commits

..

23 Commits

Author SHA1 Message Date
sky
e9996d501c 删除 RMxxx_rgmii_toolkit_dev.sh 2024-12-12 18:44:45 +08:00
sky
0dc33672f3 更新 RMxxx_rgmii_toolkit.sh 2024-12-12 18:42:27 +08:00
sky
3e1edb0a9b 更新 simpleupdates/simpleupdate 2024-12-12 18:38:21 +08:00
sky
d4465b37ca 更新 simpleupdates/scripts/update_tailscale.sh 2024-12-12 18:36:47 +08:00
sky
166bc41659 更新 simpleupdates/scripts/update_sshd.sh 2024-12-12 18:36:08 +08:00
sky
967a620da9 更新 simpleupdates/scripts/update_socat-at-bridge.sh 2024-12-12 18:35:10 +08:00
sky
2590e262da 更新 simpleupdates/scripts/update_simplefirewall.sh 2024-12-12 18:33:50 +08:00
sky
7e92dbfc93 更新 simpleupdates/scripts/update_simpleadmin.sh 2024-12-12 18:32:40 +08:00
sky
0940f0b06c 更新 RMxxx_rgmii_toolkit.sh 2024-12-12 18:31:27 +08:00
sky
18b99aa4b3 Merge pull request 'dev' (#1) from dev into beta
Reviewed-on: #1
2024-12-12 18:27:29 +08:00
sky
0a17979bad 更新 README_zh.md 2024-12-12 04:18:53 +08:00
sky
0633a7eea4 添加 RMxxx_rgmii_toolkit_dev.sh 2024-12-12 04:15:10 +08:00
sky
9357f5b17d 删除 RMxxx_rgmii_toolkit_dev.sh 2024-12-12 04:03:33 +08:00
sky
0392d614b1 更新 RMxxx_rgmii_toolkit_dev.sh 2024-12-12 03:08:04 +08:00
sky
c96a6f66f9 添加 RMxxx_rgmii_toolkit_dev.sh 2024-12-12 03:06:49 +08:00
sky
9c614d890a 更新 simpleupdates/scripts/update_tailscale.sh 2024-12-10 22:33:27 +08:00
sky
f1824ea8a0 更新 simpleupdates/scripts/update_tailscale.sh 2024-12-10 22:33:01 +08:00
sky
e3441aafae 更新 RMxxx_rgmii_toolkit.sh 2024-12-08 22:23:43 +08:00
sky
3cf93ede5f 更新 RMxxx_rgmii_toolkit.sh 2024-12-08 22:09:20 +08:00
sky
8548078982 更新 simpleadmin/console/ttyd.bash 2024-12-08 22:08:15 +08:00
sky
5364e18b14 更新 RMxxx_rgmii_toolkit.sh 2024-12-08 21:25:35 +08:00
sky
fa098833b1 更新 simpleupdates/scripts/update_simpleadmin.sh 2024-12-08 21:23:20 +08:00
sky
bc05c4db58 更新 simpleupdates/scripts/update_simpleadmin.sh 2024-12-08 20:56:36 +08:00
9 changed files with 692 additions and 634 deletions

View File

@ -62,6 +62,7 @@ adb shell
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
```
**您应该看到:**
![工具包](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulantoolkit.png?raw=true)
## Tailscale安装和配置

View File

@ -1,23 +1,42 @@
#!/bin/sh
#####################################################################
# RMxxx RGMII Toolkit
# Author: iamromulan
# Description: Toolkit for Quectel RMxxx Series modems
# Repository: https://github.com/iamromulan
#####################################################################
#####################################################################
# Environment Configuration
#####################################################################
# Define toolkit paths
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
# Define Gitea repository paths
# Define Gitea repository configuration
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
# Gitea 的 raw 文件 URL 格式为: https://[host]/[user]/[repo]/raw/branch/[branch]/[file]
# Format: https://[host]/[user]/[repo]/raw/branch/[branch]/[file]
GITROOT="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITTREE"
GITROOTMAIN="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITMAINTREE"
GITROOTDEV="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITDEVTREE"
#####################################################################
# Directory Configuration
#####################################################################
# System directories
TMP_DIR="/tmp"
USRDATA_DIR="/usrdata"
# Application directories
SOCAT_AT_DIR="/usrdata/socat-at-bridge"
SOCAT_AT_SYSD_DIR="/usrdata/socat-at-bridge/systemd_units"
SIMPLE_ADMIN_DIR="/usrdata/simpleadmin"
@ -26,9 +45,16 @@ SIMPLE_FIREWALL_SCRIPT="$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
SIMPLE_FIREWALL_SYSTEMD_DIR="$SIMPLE_FIREWALL_DIR/systemd"
TAILSCALE_DIR="/usrdata/tailscale"
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
# AT Command Script Variables and Functions
LIGHTTPD_DIR="/usrdata/lighttpd"
# AT Command configuration
DEVICE_FILE="/dev/smd7"
TIMEOUT=4 # Set a timeout for the response
#####################################################################
# Basic Utility Functions
#####################################################################
# Function to remount file system as read-write
remount_rw() {
mount -o remount,rw /
@ -39,7 +65,11 @@ remount_ro() {
mount -o remount,ro /
}
# Basic AT commands without socat bridge for fast responce commands only
#####################################################################
# AT Command Functions
#####################################################################
# Basic AT commands without socat bridge for fast response commands only
start_listening() {
cat "$DEVICE_FILE" > /tmp/device_readout &
CAT_PID=$!
@ -110,6 +140,10 @@ send_at_commands() {
fi
}
#####################################################################
# Installation and Package Management Functions
#####################################################################
# Check for existing Entware/opkg installation, install if not installed
ensure_entware_installed() {
remount_rw
@ -218,7 +252,239 @@ uninstall_entware() {
echo -e '\033[32mInfo: Entware/OPKG has been uninstalled successfully.\033[0m'
}
# function to configure the fetures of simplefirewall
#####################################################################
# System Service and Configuration Functions
#####################################################################
# Function to manage Daily Reboot Timer
manage_reboot_timer() {
# Remount root filesystem as read-write
mount -o remount,rw /
# Check if the rebootmodem service, timer, or trigger already exists
if [ -f /lib/systemd/system/rebootmodem.service ] || [ -f /lib/systemd/system/rebootmodem.timer ] || [ -f /lib/systemd/system/rebootmodem-trigger.service ]; then
echo -e "\e[1;32mThe rebootmodem service/timer/trigger is already installed.\e[0m"
echo -e "\e[1;32m1) Change\e[0m" # Green
echo -e "\e[1;31m2) Remove\e[0m" # Red
read -p "Enter your choice (1 for Change, 2 for Remove): " reboot_choice
case $reboot_choice in
2)
# Stop and disable timer and trigger service by removing symlinks
systemctl stop rebootmodem.timer
systemctl stop rebootmodem-trigger.service
# Remove symbolic links and files
rm -f /lib/systemd/system/multi-user.target.wants/rebootmodem-trigger.service
rm -f /lib/systemd/system/rebootmodem.service
rm -f /lib/systemd/system/rebootmodem.timer
rm -f /lib/systemd/system/rebootmodem-trigger.service
rm -f "$USRDATA_DIR/reboot_modem.sh"
# Reload systemd to apply changes
systemctl daemon-reload
echo -e "\e[1;32mRebootmodem service, timer, trigger, and script removed successfully.\e[0m"
;;
1)
printf "Enter the new time for daily reboot (24-hour format in Coordinated Universal Time, HH:MM): "
read new_time
# Validate the new time format using grep
if ! echo "$new_time" | grep -qE '^([01]?[0-9]|2[0-3]):[0-5][0-9]$'; then
echo "Invalid time format. Exiting."
exit 1
else
# Remove old symlinks and script
rm -f /lib/systemd/system/multi-user.target.wants/rebootmodem-trigger.service
rm -f "$USRDATA_DIR/reboot_modem.sh"
# Set the user time to the new time and recreate the service, timer, trigger, and script
user_time=$new_time
create_service_and_timer
fi
;;
*)
echo -e "\e[1;31mInvalid choice. Exiting.\e[0m"
exit 1
;;
esac
else
printf "Enter the time for daily reboot (24-hour format in UTC, HH:MM): "
read user_time
# Validate the time format using grep
if ! echo "$user_time" | grep -qE '^([01]?[0-9]|2[0-3]):[0-5][0-9]$'; then
echo "Invalid time format. Exiting."
exit 1
else
create_service_and_timer
fi
fi
# Remount root filesystem as read-only
mount -o remount,ro /
}
# Function to create systemd service and timer files
create_service_and_timer() {
remount_rw
# Define the path for the modem reboot script
MODEM_REBOOT_SCRIPT="$USRDATA_DIR/reboot_modem.sh"
# Create the modem reboot script
echo "#!/bin/sh
/bin/echo -e 'AT+CFUN=1,1 \r' > /dev/smd7" > "$MODEM_REBOOT_SCRIPT"
# Make the script executable
chmod +x "$MODEM_REBOOT_SCRIPT"
# Create the systemd service file for reboot
echo "[Unit]
Description=Reboot Modem Daily
[Service]
Type=oneshot
ExecStart=/bin/sh /usrdata/reboot_modem.sh
Restart=no
RemainAfterExit=no" > /lib/systemd/system/rebootmodem.service
# Create the systemd timer file with the user-specified time
echo "[Unit]
Description=Starts rebootmodem.service daily at the specified time
[Timer]
OnCalendar=*-*-* $user_time:00
Persistent=false" > /lib/systemd/system/rebootmodem.timer
# Create a trigger service that starts the timer at boot
echo "[Unit]
Description=Trigger the rebootmodem timer at boot
[Service]
Type=oneshot
ExecStart=/bin/systemctl start rebootmodem.timer
RemainAfterExit=yes" > /lib/systemd/system/rebootmodem-trigger.service
# Create symbolic links for the trigger service in the wanted directory
ln -sf /lib/systemd/system/rebootmodem-trigger.service /lib/systemd/system/multi-user.target.wants/
# Reload systemd to recognize the new timer and trigger service
systemctl daemon-reload
sleep 2s
# Start the trigger service, which will start the timer
systemctl start rebootmodem-trigger.service
remount_ro
# Confirmation
echo -e "\e[1;32mRebootmodem-trigger service created and started successfully.\e[0m"
echo -e "\e[1;32mReboot schedule set successfully. The modem will reboot daily at $user_time UTC.\e[0m"
}
# Function to manage CFUN fix
manage_cfun_fix() {
cfun_service_path="/lib/systemd/system/cfunfix.service"
cfun_fix_script="/usrdata/cfun_fix.sh"
mount -o remount,rw /
if [ -f "$cfun_service_path" ]; then
echo -e "\e[1;32mThe CFUN fix is already installed. Do you want to remove it?\e[0m" # Green
echo -e "\e[1;32m1) Yes\e[0m" # Green
echo -e "\e[1;31m2) No\e[0m" # Red
read -p "Enter your choice: " choice
if [ "$choice" = "1" ]; then
echo "Removing CFUN fix..."
systemctl stop cfunfix.service
rm -f /lib/systemd/system/multi-user.target.wants/cfunfix.service
rm -f "$cfun_service_path"
rm -f "$cfun_fix_script"
systemctl daemon-reload
echo "CFUN fix has been removed."
else
echo "Returning to main menu..."
fi
else
echo -e "\e[1;32mInstalling CFUN fix...\e[0m"
# Create the CFUN fix script
echo "#!/bin/sh
/bin/echo -e 'AT+CFUN=1 \r' > /dev/smd7" > "$cfun_fix_script"
chmod +x "$cfun_fix_script"
# Create the systemd service file to execute the CFUN fix script at boot
echo "[Unit]
Description=CFUN Fix Service
After=network.target
[Service]
Type=oneshot
ExecStart=$cfun_fix_script
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target" > "$cfun_service_path"
ln -sf "$cfun_service_path" "/lib/systemd/system/multi-user.target.wants/"
systemctl daemon-reload
mount -o remount,ro /
echo -e "\e[1;32mCFUN fix has been installed and will execute at every boot.\e[0m"
fi
}
#####################################################################
# SimpleAdmin Functions
#####################################################################
# Function to set SimpleAdmin password
set_simpleadmin_passwd(){
ensure_entware_installed
opkg update
opkg install libaprutil
wget -O /usrdata/root/bin/htpasswd $GITROOT/simpleadmin/htpasswd && chmod +x /usrdata/root/bin/htpasswd
wget -O /usrdata/root/bin/simplepasswd $GITROOT/simpleadmin/simplepasswd && chmod +x /usrdata/root/bin/simplepasswd
echo -e "\e[1;32mTo change your simpleadmin (admin) password in the future...\e[0m"
echo -e "\e[1;32mIn the console type simplepasswd and press enter\e[0m"
/usrdata/root/bin/simplepasswd
}
# Function to set root password
set_root_passwd() {
echo -e "\e[1;31mPlease set the root/console password.\e[0m"
/opt/bin/passwd
}
# Function to install/update Simple Admin
install_simple_admin() {
echo -e "\e[1;32mInstalling Simpleadmin 2.0\e[0m"
ensure_entware_installed
echo -e "\e[1;31m2) Installing Simpleadmin 2.0\e[0m"
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh $GITROOT/simpleupdates/scripts/update_socat-at-bridge.sh && chmod +x /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mInstalling/updating dependency: socat-at-bridge\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32m Dependency: socat-at-bridge has been updated/installed.\e[0m"
sleep 1
wget -O /usrdata/simpleupdates/scripts/update_simplefirewall.sh $GITROOT/simpleupdates/scripts/update_simplefirewall.sh && chmod +x /usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mInstalling/updating dependency: simplefirewall\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32m Dependency: simplefirewall has been updated/installed.\e[0m"
sleep 1
set_simpleadmin_passwd
wget -O /usrdata/simpleupdates/scripts/update_simpleadmin.sh $GITROOT/simpleupdates/scripts/update_simpleadmin.sh && chmod +x /usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mInstalling/updating: Simpleadmin content\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mSimpleadmin content has been updated/installed.\e[0m"
sleep 1
}
# Function to configure Simple Firewall
configure_simple_firewall() {
if [ ! -f "$SIMPLE_FIREWALL_SCRIPT" ]; then
echo -e "\033[0;31mSimplefirewall is not installed, would you like to install it?\033[0m"
@ -310,52 +576,6 @@ configure_simple_firewall() {
echo -e "\e[1;32mFirewall configuration updated.\e[0m"
}
set_simpleadmin_passwd(){
ensure_entware_installed
opkg update
opkg install libaprutil
wget -O /usrdata/root/bin/htpasswd $GITROOT/simpleadmin/htpasswd && chmod +x /usrdata/root/bin/htpasswd
wget -O /usrdata/root/bin/simplepasswd $GITROOT/simpleadmin/simplepasswd && chmod +x /usrdata/root/bin/simplepasswd
echo -e "\e[1;32mTo change your simpleadmin (admin) password in the future...\e[0m"
echo -e "\e[1;32mIn the console type simplepasswd and press enter\e[0m"
/usrdata/root/bin/simplepasswd
}
set_root_passwd() {
echo -e "\e[1;31mPlease set the root/console password.\e[0m"
/opt/bin/passwd
}
# Function to install/update Simple Admin
install_simple_admin() {
echo -e "\e[1;32mInstalling Simpleadmin 2.0\e[0m"
ensure_entware_installed
echo -e "\e[1;31m2) Installing Simpleadmin 2.0\e[0m"
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh $GITROOT/simpleupdates/scripts/update_socat-at-bridge.sh && chmod +x /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mInstalling/updating dependency: socat-at-bridge\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32m Dependency: socat-at-bridge has been updated/installed.\e[0m"
sleep 1
wget -O /usrdata/simpleupdates/scripts/update_simplefirewall.sh $GITROOT/simpleupdates/scripts/update_simplefirewall.sh && chmod +x /usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mInstalling/updating dependency: simplefirewall\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32m Dependency: simplefirewall has been updated/installed.\e[0m"
sleep 1
set_simpleadmin_passwd
wget -O /usrdata/simpleupdates/scripts/update_simpleadmin.sh $GITROOT/simpleupdates/scripts/update_simpleadmin.sh && chmod +x /usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mInstalling/updating: Simpleadmin content\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simpleadmin.sh
echo -e "\e[1;32mSimpleadmin content has been updated/installed.\e[0m"
sleep 1
break
}
# Function to Uninstall Simpleadmin and dependencies
uninstall_simpleadmin_components() {
echo -e "\e[1;32mStarting the uninstallation process for Simpleadmin components.\e[0m"
@ -452,25 +672,31 @@ uninstall_simpleadmin_components() {
echo "Uninstallation process completed."
}
#####################################################################
# Tailscale Management Functions
#####################################################################
# Function for Tailscale Submenu
tailscale_menu() {
while true; do
echo -e "\e[1;32mTailscale Menu\e[0m"
echo -e "\e[1;32m1) Install/Update Tailscale\e[0m"
echo -e "\e[1;36m2) Configure Tailscale\e[0m"
echo -e "\e[1;31m3) Return to Main Menu\e[0m"
echo -e "\e[1;31m3) Uninstall Tailscale\e[0m"
echo -e "\e[1;93m4) Return to Main Menu\e[0m"
read -p "Enter your choice: " tailscale_choice
case $tailscale_choice in
1) install_update_tailscale;;
2) configure_tailscale;;
3) break;;
3) uninstall_tailscale;;
4) break;;
*) echo "Invalid option";;
esac
done
}
# Function to install, update, or remove Tailscale
# Function to install or update Tailscale
install_update_tailscale() {
echo -e "\e[1;31m2) Installing tailscale from the $GITTREE branch\e[0m"
ensure_entware_installed
@ -484,6 +710,37 @@ echo -e "\e[1;31m2) Installing tailscale from the $GITTREE branch\e[0m"
echo -e "\e[1;32m Tailscale has been updated/installed.\e[0m"
}
# Function to uninstall Tailscale
uninstall_tailscale() {
echo -e "\e[1;31mUninstalling Tailscale...\e[0m"
# Stop and logout from Tailscale
if [ -f "/usrdata/tailscale/tailscale" ]; then
/usrdata/tailscale/tailscale logout
/usrdata/tailscale/tailscale down
fi
# Stop services
systemctl stop tailscale 2>/dev/null
systemctl stop tailscale-webui 2>/dev/null
# Remove service files
rm -f /lib/systemd/system/tailscale.service
rm -f /lib/systemd/system/tailscale-webui.service
rm -f /lib/systemd/system/tailscale-webui-trigger.service
rm -f /lib/systemd/system/multi-user.target.wants/tailscale-webui-trigger.service
# Remove Tailscale files and directories
rm -rf /usrdata/tailscale
rm -f /bin/tailscale
rm -f /bin/tailscaled
# Reload systemd
systemctl daemon-reload
echo -e "\e[1;32mTailscale has been uninstalled.\e[0m"
}
# Function to Configure Tailscale
configure_tailscale() {
while true; do
@ -535,184 +792,11 @@ configure_tailscale() {
done
}
# Function to manage Daily Reboot Timer
manage_reboot_timer() {
# Remount root filesystem as read-write
mount -o remount,rw /
# Check if the rebootmodem service, timer, or trigger already exists
if [ -f /lib/systemd/system/rebootmodem.service ] || [ -f /lib/systemd/system/rebootmodem.timer ] || [ -f /lib/systemd/system/rebootmodem-trigger.service ]; then
echo -e "\e[1;32mThe rebootmodem service/timer/trigger is already installed.\e[0m"
echo -e "\e[1;32m1) Change\e[0m" # Green
echo -e "\e[1;31m2) Remove\e[0m" # Red
read -p "Enter your choice (1 for Change, 2 for Remove): " reboot_choice
case $reboot_choice in
2)
# Stop and disable timer and trigger service by removing symlinks
systemctl stop rebootmodem.timer
systemctl stop rebootmodem-trigger.service
# Remove symbolic links and files
rm -f /lib/systemd/system/multi-user.target.wants/rebootmodem-trigger.service
rm -f /lib/systemd/system/rebootmodem.service
rm -f /lib/systemd/system/rebootmodem.timer
rm -f /lib/systemd/system/rebootmodem-trigger.service
rm -f "$USRDATA_DIR/reboot_modem.sh"
# Reload systemd to apply changes
systemctl daemon-reload
echo -e "\e[1;32mRebootmodem service, timer, trigger, and script removed successfully.\e[0m"
;;
1)
printf "Enter the new time for daily reboot (24-hour format in Coordinated Universal Time, HH:MM): "
read new_time
# Validate the new time format using grep
if ! echo "$new_time" | grep -qE '^([01]?[0-9]|2[0-3]):[0-5][0-9]$'; then
echo "Invalid time format. Exiting."
exit 1
else
# Remove old symlinks and script
rm -f /lib/systemd/system/multi-user.target.wants/rebootmodem-trigger.service
rm -f "$USRDATA_DIR/reboot_modem.sh"
# Set the user time to the new time and recreate the service, timer, trigger, and script
user_time=$new_time
create_service_and_timer
fi
;;
*)
echo -e "\e[1;31mInvalid choice. Exiting.\e[0m"
exit 1
;;
esac
else
printf "Enter the time for daily reboot (24-hour format in UTC, HH:MM): "
read user_time
# Validate the time format using grep
if ! echo "$user_time" | grep -qE '^([01]?[0-9]|2[0-3]):[0-5][0-9]$'; then
echo "Invalid time format. Exiting."
exit 1
else
create_service_and_timer
fi
fi
# Remount root filesystem as read-only
mount -o remount,ro /
}
# Function to create systemd service and timer files with the user-specified time for the reboot timer
create_service_and_timer() {
remount_rw
# Define the path for the modem reboot script
MODEM_REBOOT_SCRIPT="$USRDATA_DIR/reboot_modem.sh"
# Create the modem reboot script
echo "#!/bin/sh
/bin/echo -e 'AT+CFUN=1,1 \r' > /dev/smd7" > "$MODEM_REBOOT_SCRIPT"
# Make the script executable
chmod +x "$MODEM_REBOOT_SCRIPT"
# Create the systemd service file for reboot
echo "[Unit]
Description=Reboot Modem Daily
[Service]
Type=oneshot
ExecStart=/bin/sh /usrdata/reboot_modem.sh
Restart=no
RemainAfterExit=no" > /lib/systemd/system/rebootmodem.service
# Create the systemd timer file with the user-specified time
echo "[Unit]
Description=Starts rebootmodem.service daily at the specified time
[Timer]
OnCalendar=*-*-* $user_time:00
Persistent=false" > /lib/systemd/system/rebootmodem.timer
# Create a trigger service that starts the timer at boot
echo "[Unit]
Description=Trigger the rebootmodem timer at boot
[Service]
Type=oneshot
ExecStart=/bin/systemctl start rebootmodem.timer
RemainAfterExit=yes" > /lib/systemd/system/rebootmodem-trigger.service
# Create symbolic links for the trigger service in the wanted directory
ln -sf /lib/systemd/system/rebootmodem-trigger.service /lib/systemd/system/multi-user.target.wants/
# Reload systemd to recognize the new timer and trigger service
systemctl daemon-reload
sleep 2s
# Start the trigger service, which will start the timer
systemctl start rebootmodem-trigger.service
remount_ro
# Confirmation
echo -e "\e[1;32mRebootmodem-trigger service created and started successfully.\e[0m"
echo -e "\e[1;32mReboot schedule set successfully. The modem will reboot daily at $user_time UTC.\e[0m"
}
manage_cfun_fix() {
cfun_service_path="/lib/systemd/system/cfunfix.service"
cfun_fix_script="/usrdata/cfun_fix.sh"
mount -o remount,rw /
if [ -f "$cfun_service_path" ]; then
echo -e "\e[1;32mThe CFUN fix is already installed. Do you want to remove it?\e[0m" # Green
echo -e "\e[1;32m1) Yes\e[0m" # Green
echo -e "\e[1;31m2) No\e[0m" # Red
read -p "Enter your choice: " choice
if [ "$choice" = "1" ]; then
echo "Removing CFUN fix..."
systemctl stop cfunfix.service
rm -f /lib/systemd/system/multi-user.target.wants/cfunfix.service
rm -f "$cfun_service_path"
rm -f "$cfun_fix_script"
systemctl daemon-reload
echo "CFUN fix has been removed."
else
echo "Returning to main menu..."
fi
else
echo -e "\e[1;32mInstalling CFUN fix...\e[0m"
# Create the CFUN fix script
echo "#!/bin/sh
/bin/echo -e 'AT+CFUN=1 \r' > /dev/smd7" > "$cfun_fix_script"
chmod +x "$cfun_fix_script"
# Create the systemd service file to execute the CFUN fix script at boot
echo "[Unit]
Description=CFUN Fix Service
After=network.target
[Service]
Type=oneshot
ExecStart=$cfun_fix_script
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target" > "$cfun_service_path"
ln -sf "$cfun_service_path" "/lib/systemd/system/multi-user.target.wants/"
systemctl daemon-reload
mount -o remount,ro /
echo -e "\e[1;32mCFUN fix has been installed and will execute at every boot.\e[0m"
fi
}
#####################################################################
# Tool Installation Functions
#####################################################################
# Function to install OpenSSH Server
install_sshd() {
if [ -d "/usrdata/sshd" ]; then
echo -e "\e[1;31mSSHD is currently installed.\e[0m"
@ -724,6 +808,14 @@ install_sshd() {
case $sshd_choice in
1)
echo -e "\e[1;31m2) Installing sshd from the $GITTREE branch\e[0m"
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_sshd.sh $GITROOT/simpleupdates/scripts/update_sshd.sh && chmod +x /usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32mUpdating: SSHd\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32m SSHd has been updated.\e[0m"
;;
2)
echo -e "\e[1;31mUninstalling SSHD...\e[0m"
@ -740,170 +832,19 @@ install_sshd() {
esac
fi
# Proceed with installation or updating if not uninstalling
# Proceed with installation if not installed
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_sshd.sh $GITROOT/simpleupdates/scripts/update_sshd.sh && chmod +x /usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32mInstalling/updating: SSHd\e[0m"
echo -e "\e[1;32mInstalling: SSHd\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32m SSHd has been updated/installed.\e[0m"
echo -e "\e[1;32m SSHd has been installed.\e[0m"
}
# Main menu
ARCH=$(uname -a)
if echo "$ARCH" | grep -q "aarch64"; then
cd /tmp && wget -O RM55x_rcPCIe_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/SDXPINN/RM55x_rcPCIe_toolkit.sh && chmod +x RM55x_rcPCIe_toolkit.sh && ./RM55x_rcPCIe_toolkit.sh && cd /
exit 0
elif echo "$ARCH" | grep -q "armv7l"; then
# Continue if architecture is armv7l
echo "Architecture is armv7l, continuing..."
else
uname -a
echo "Unsupported architecture."
exit 1
fi
while true; do
echo " .%+: "
echo " .*@@@-. "
echo " :@@@@- "
echo " @@@@#. "
echo " -@@@@#. "
echo " :. %@@@@: -# "
echo " .+- #@@@@%.+@- "
echo " .#- . +@@@@# #@- "
echo " -@*@*@% @@@@@::@@= "
echo ".+%@@@@@@@@@%=. =@@@@# #@@- .. "
echo " .@@@@@: :@@@@@ =@@@..%= "
echo " -::@-.+. @@@@@.=@@@- =@- "
echo " .@- .@@@@@:.@@@* @@. "
echo " .%- -@@@@@:=@@@@ @@# "
echo " .#- .%@@@@@@#. +@@@@@.#@@@@ @@@."
echo " .*- .@@@@@@@@@@=. @@@@@@ @@@@@ @@@:"
echo " :. .%@@@@@@@@@@@%. .@@@@@+:@@@@@ @@@-"
echo " -@@@@@@@@@@@@@@@..@@@@@@.-@@@@@ .@@@-"
echo " -@@@@@@@@@@%. .@@@@@@. @@@@@+ =@@@="
echo " =@@@@@@@@* .@@@@@@. @@@@@@..@@@@-"
echo " #@@@@@@@@-*@@@@@%..@@@@@@+ #@@@@-"
echo " @@@@@@:.-@@@@@@. @@@@@@= %@@@@@."
echo " .@@@@. *@@@@@@- .+@@@@@@-.@@@@@@+ "
echo " %@@. =@@@@@*. +@@@@@@%.-@@@@@@% "
echo " .@@ .@@@@@= :@@@@@@@@..@@@@@@@= "
echo " =@.+@@@@@. -@@@@@@@*.:@@@@@@@*. "
echo " %.*@@@@= .@@@@@@@-.:@@@@@@@+. "
echo " ..@@@@= .@@@@@@: #@@@@@@@: "
echo " .@@@@ +@@@@..%@@@@@+. "
echo " .@@@. @@@@.:@@@@+. "
echo " @@@. @@@. @@@* .@. "
echo " :@@@ %@@..@@#. *@ "
echo " -*: .@@* :@@. @@. -..@@ "
echo " =@@@@@@.*@- :@% @* =@:=@# "
echo " .@@@-+@@@@:%@..%- ...@%:@@: "
echo " .@@. @@-%@: .%@@*@@%. "
echo " :@@ :+ *@ *@@#*@@@. "
echo " =@@@.@@@@ "
echo " .*@@@:=@@@@: "
echo " .@@@@:.@@@@@: "
echo " .@@@@#.-@@@@@. "
echo " #@@@@: =@@@@@- "
echo " .@@@@@..@@@@@@* "
echo " -@@@@@. @@@@@@#. "
echo " -@@@@@ @@@@@@% "
echo " @@@@@. #@@@@@@. "
echo " :@@@@# =@@@@@@% "
echo " @@@@@: @@@@@@@: "
echo " *@@@@ @@@@@@@. "
echo " .@@@@ @@@@@@@ "
echo " #@@@. @@@@@@* "
echo " @@@# @@@@@@@ "
echo " .@@+=@@@@@@. "
echo " *@@@@@@ "
echo " :@@@@@= "
echo " .@@@@@@. "
echo " :@@@@@*. "
echo " .=@@@@@- "
echo " :+##+. "
echo -e "\e[92m"
echo "Welcome to iamromulan's RGMII Toolkit script for Quectel RMxxx Series modems!"
echo "Visit https://github.com/iamromulan for more!"
echo -e "\e[0m"
echo "Select an option:"
echo -e "\e[0m"
echo -e "\e[96m1) Send AT Commands\e[0m" # Cyan
echo -e "\e[93m2) Install Simple Admin\e[0m" # Yellow
echo -e "\e[95m3) Set Simpleadmin (admin) password\e[0m" # Light Purple
echo -e "\e[94m4) Set Console/ttyd (root) password\e[0m" # Light Blue
echo -e "\e[91m5) Uninstall Simple Admin\e[0m" # Light Red
echo -e "\e[95m6) Simple Firewall Management\e[0m" # Light Purple
echo -e "\e[94m7) Tailscale Management\e[0m" # Light Blue
echo -e "\e[92m8) Install/Change or remove Daily Reboot Timer\e[0m" # Light Green
echo -e "\e[96m9) Install/Uninstall CFUN 0 Fix\e[0m" # Cyan (repeated color for additional options)
echo -e "\e[91m10) Uninstall Entware/OPKG\e[0m" # Light Red
echo -e "\e[92m11) Install Speedtest.net CLI app (speedtest command)\e[0m" # Light Green
echo -e "\e[92m12) Install Fast.com CLI app (fast command)(tops out at 40Mbps)\e[0m" # Light Green
echo -e "\e[92m13) Install OpenSSH Server\e[0m" # Light Green
echo -e "\e[93m14) Exit\e[0m" # Yellow (repeated color for exit option)
read -p "Enter your choice: " choice
case $choice in
1)
send_at_commands
;;
2)
install_simple_admin
;;
3) set_simpleadmin_passwd
;;
4)
set_root_passwd
;;
5)
uninstall_simpleadmin_components
;;
6)
configure_simple_firewall
;;
7)
tailscale_menu
;;
8)
manage_reboot_timer
;;
9)
manage_cfun_fix
;;
10)
echo -e "\033[31mAre you sure you want to uninstall entware?\033[0m"
echo -e "\033[31m1) Yes\033[0m"
echo -e "\033[31m2) No\033[0m"
read -p "Select an option (1 or 2): " user_choice
case $user_choice in
1)
# If yes, uninstall existing entware
echo -e "\033[31mUninstalling existing entware...\033[0m"
uninstall_entware # Assuming uninstall_entware is a defined function or command
echo -e "\033[31mEntware has been uninstalled.\033[0m"
;;
2)
# If no, exit the script
echo -e "\033[31mUninstallation cancelled.\033[0m"
exit # Use 'exit' to terminate the script outside a loop
;;
*)
# Handle invalid input
echo -e "\033[31mInvalid option. Please select 1 or 2.\033[0m"
;;
esac
;;
11)
# Function to install Speedtest CLI
install_speedtest_cli() {
ensure_entware_installed
echo -e "\e[1;32mInstalling Speedtest.net CLI (speedtest command)\e[0m"
remount_rw
@ -922,8 +863,10 @@ echo " :+##+. "
echo -e "\e[1;32mNote that it will not work unless you login to the root account first\e[0m"
echo -e "\e[1;32mNormaly only an issue in adb, ttyd and ssh you are forced to login\e[0m"
echo -e "\e[1;32mIf in adb just type login and then try to run the speedtest command\e[0m"
;;
12)
}
# Function to install Fast.com CLI
install_fast_cli() {
echo -e "\e[1;32mInstalling fast.com CLI (fast command)\e[0m"
remount_rw
mkdir /usrdata/root
@ -936,10 +879,151 @@ echo " :+##+. "
echo -e "\e[1;32mFast.com CLI (speedtest command) installed!!\e[0m"
echo -e "\e[1;32mTry running the command 'fast'\e[0m"
echo -e "\e[1;32mThe fast.com test tops out at 40Mbps on the modem\e[0m"
}
#####################################################################
# AT Command Bridge Functions
#####################################################################
# Function to install/update AT command socat bridge
install_update_at_socat() {
local current_dir=$(pwd)
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh $GITROOT/simpleupdates/scripts/update_socat-at-bridge.sh && chmod +x /usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mInstalling/updating: AT Socat Bridge\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_socat-at-bridge.sh
echo -e "\e[1;32mAT Socat Bridge has been updated/installed.\e[0m"
cd "$current_dir"
}
#####################################################################
# Firewall Functions
#####################################################################
# Function to install Simple Firewall
install_simple_firewall() {
ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
wget -O /usrdata/simpleupdates/scripts/update_simplefirewall.sh $GITROOT/simpleupdates/scripts/update_simplefirewall.sh && chmod +x /usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mInstalling/updating: Simple Firewall\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_simplefirewall.sh
echo -e "\e[1;32mSimple Firewall has been updated/installed.\e[0m"
}
#####################################################################
# Main Menu and Program Flow
#####################################################################
# Check system architecture and proceed accordingly
check_architecture() {
ARCH=$(uname -a)
if echo "$ARCH" | grep -q "aarch64"; then
cd /tmp && wget -O RM55x_rcPCIe_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/SDXPINN/RM55x_rcPCIe_toolkit.sh && chmod +x RM55x_rcPCIe_toolkit.sh && ./RM55x_rcPCIe_toolkit.sh && cd /
exit 0
elif echo "$ARCH" | grep -q "armv7l"; then
# Continue if architecture is armv7l
echo "Architecture is armv7l, continuing..."
else
uname -a
echo "Unsupported architecture."
exit 1
fi
}
# Display the main menu
display_main_menu() {
echo "//////////////////////////////////////////////////////////////////"
echo "// //"
echo "// //"
echo "// :'######::'####:'##::::'##:'########::'##:::::::'########: //"
echo "// '##... ##:. ##:: ###::'###: ##.... ##: ##::::::: ##.....:: //"
echo "// ##:::..::: ##:: ####'####: ##:::: ##: ##::::::: ##::::::: //"
echo "// . ######::: ##:: ## ### ##: ########:: ##::::::: ######::: //"
echo "// :..... ##:: ##:: ##. #: ##: ##.....::: ##::::::: ##...:::: //"
echo "// '##::: ##:: ##:: ##:.:: ##: ##:::::::: ##::::::: ##::::::: //"
echo "// . ######::'####: ##:::: ##: ##:::::::: ########: ########: //"
echo "// :......:::....::..:::::..::..:::::::::........::........:: //"
echo "// :::'###::::'########::'##::::'##:'####:'##::: ##: //"
echo "// ::'## ##::: ##.... ##: ###::'###:. ##:: ###:: ##: //"
echo "// :'##:. ##:: ##:::: ##: ####'####:: ##:: ####: ##: //"
echo "// '##:::. ##: ##:::: ##: ## ### ##:: ##:: ## ## ##: //"
echo "// #########: ##:::: ##: ##. #: ##:: ##:: ##. ####: //"
echo "// ##.... ##: ##:::: ##: ##:.:: ##:: ##:: ##:. ###: //"
echo "// ##:::: ##: ########:: ##:::: ##:'####: ##::. ##: //"
echo "// ..:::::..::........:::..:::::..::....::..::::..:: //"
echo "// //"
echo "// By iamromulan //"
echo "//////////////////////////////////////////////////////////////////"
echo -e "\e[92m"
echo "Welcome to iamromulan's RGMII Toolkit script for Quectel RMxxx Series modems!"
echo "Visit https://github.com/iamromulan for more!"
echo -e "\e[0m"
echo "Select an option:"
echo -e "\e[0m"
echo -e "\e[96m1) Send AT Commands\e[0m" # Cyan
echo -e "\e[93m2) Install Simple Admin\e[0m" # Yellow
echo -e "\e[95m3) Set Simpleadmin (admin) password\e[0m" # Light Purple
echo -e "\e[94m4) Set Console/ttyd (root) password\e[0m" # Light Blue
echo -e "\e[91m5) Uninstall Simple Admin\e[0m" # Light Red
echo -e "\e[95m6) Simple Firewall Management\e[0m" # Light Purple
echo -e "\e[94m7) Tailscale Management\e[0m" # Light Blue
echo -e "\e[92m8) Install/Change or remove Daily Reboot Timer\e[0m" # Light Green
echo -e "\e[96m9) Install/Uninstall CFUN 0 Fix\e[0m" # Cyan
echo -e "\e[91m10) Uninstall Entware/OPKG\e[0m" # Light Red
echo -e "\e[92m11) Install Speedtest.net CLI app (speedtest command)\e[0m" # Light Green
echo -e "\e[92m12) Install Fast.com CLI app (fast command)(tops out at 40Mbps)\e[0m" # Light Green
echo -e "\e[92m13) Install OpenSSH Server\e[0m" # Light Green
echo -e "\e[93m14) Exit\e[0m" # Yellow
}
# Main program loop
main() {
check_architecture
while true; do
display_main_menu
read -p "Enter your choice: " choice
case $choice in
1) send_at_commands;;
2) install_simple_admin;;
3) set_simpleadmin_passwd;;
4) set_root_passwd;;
5) uninstall_simpleadmin_components;;
6) configure_simple_firewall;;
7) tailscale_menu;;
8) manage_reboot_timer;;
9) manage_cfun_fix;;
10)
echo -e "\033[31mAre you sure you want to uninstall entware?\033[0m"
echo -e "\033[31m1) Yes\033[0m"
echo -e "\033[31m2) No\033[0m"
read -p "Select an option (1 or 2): " user_choice
case $user_choice in
1)
echo -e "\033[31mUninstalling existing entware...\033[0m"
uninstall_entware
echo -e "\033[31mEntware has been uninstalled.\033[0m"
;;
13)
install_sshd
2)
echo -e "\033[31mUninstallation cancelled.\033[0m"
exit
;;
*)
echo -e "\033[31mInvalid option. Please select 1 or 2.\033[0m"
;;
esac
;;
11) install_speedtest_cli;;
12) install_fast_cli;;
13) install_sshd;;
14)
echo -e "\e[1;32mGoodbye!\e[0m"
break
@ -949,3 +1033,7 @@ echo " :+##+. "
;;
esac
done
}
# Start the program
main

View File

@ -11,89 +11,35 @@ else
firmware_revision="UNKNOWN"
fi
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
echo "=============================================================="
# Start your Actual echo output here, 17 lines omitted for mobile compatibility. ttyd font needs to be size 25.
# Echo "Logo"
echo " .%+: "
echo " .*@@@-. "
echo " :@@@@- "
echo " @@@@#. "
echo " -@@@@#. "
echo " :. %@@@@: -# "
echo " .+- #@@@@%.+@- "
echo " .#- . +@@@@# #@- "
echo " -@*@*@% @@@@@::@@= "
echo ".+%@@@@@@@@@%=. =@@@@# #@@- .. "
echo " .@@@@@: :@@@@@ =@@@..%= "
echo " -::@-.+. @@@@@.=@@@- =@- "
echo " .@- .@@@@@:.@@@* @@. "
echo " .%- -@@@@@:=@@@@ @@# "
echo " .#- .%@@@@@@#. +@@@@@.#@@@@ @@@."
echo " .*- .@@@@@@@@@@=. @@@@@@ @@@@@ @@@:"
echo " :. .%@@@@@@@@@@@%. .@@@@@+:@@@@@ @@@-"
echo " -@@@@@@@@@@@@@@@..@@@@@@.-@@@@@ .@@@-"
echo " -@@@@@@@@@@%. .@@@@@@. @@@@@+ =@@@="
echo " =@@@@@@@@* .@@@@@@. @@@@@@..@@@@-"
echo " #@@@@@@@@-*@@@@@%..@@@@@@+ #@@@@-"
echo " @@@@@@:.-@@@@@@. @@@@@@= %@@@@@."
echo " .@@@@. *@@@@@@- .+@@@@@@-.@@@@@@+ "
echo " %@@. =@@@@@*. +@@@@@@%.-@@@@@@% "
echo " .@@ .@@@@@= :@@@@@@@@..@@@@@@@= "
echo " =@.+@@@@@. -@@@@@@@*.:@@@@@@@*. "
echo " %.*@@@@= .@@@@@@@-.:@@@@@@@+. "
echo " ..@@@@= .@@@@@@: #@@@@@@@: "
echo " .@@@@ +@@@@..%@@@@@+. "
echo " .@@@. @@@@.:@@@@+. "
echo " @@@. @@@. @@@* .@. "
echo " :@@@ %@@..@@#. *@ "
echo " -*: .@@* :@@. @@. -..@@ "
echo " =@@@@@@.*@- :@% @* =@:=@# "
echo " .@@@-+@@@@:%@..%- ...@%:@@: "
echo " .@@. @@-%@: .%@@*@@%. "
echo " :@@ :+ *@ *@@#*@@@. "
echo " =@@@.@@@@ "
echo " .*@@@:=@@@@: "
echo " .@@@@:.@@@@@: "
echo " .@@@@#.-@@@@@. "
echo " #@@@@: =@@@@@- "
echo " .@@@@@..@@@@@@* "
echo " -@@@@@. @@@@@@#. "
echo " -@@@@@ @@@@@@% "
echo " @@@@@. #@@@@@@. "
echo " :@@@@# =@@@@@@% "
echo " @@@@@: @@@@@@@: "
echo " *@@@@ @@@@@@@. "
echo " .@@@@ @@@@@@@ "
echo " #@@@. @@@@@@* "
echo " @@@# @@@@@@@ "
echo " .@@+=@@@@@@. "
echo " *@@@@@@ "
echo " :@@@@@= "
echo " .@@@@@@. "
echo " :@@@@@*. "
echo " .=@@@@@- "
echo " :+##+. "
echo "=============================================================="
echo "//////////////////////////////////////////////////////////////////";
echo "// //";
echo "// //";
echo "// :'######::'####:'##::::'##:'########::'##:::::::'########: //";
echo "// '##... ##:. ##:: ###::'###: ##.... ##: ##::::::: ##.....:: //";
echo "// ##:::..::: ##:: ####'####: ##:::: ##: ##::::::: ##::::::: //";
echo "// . ######::: ##:: ## ### ##: ########:: ##::::::: ######::: //";
echo "// :..... ##:: ##:: ##. #: ##: ##.....::: ##::::::: ##...:::: //";
echo "// '##::: ##:: ##:: ##:.:: ##: ##:::::::: ##::::::: ##::::::: //";
echo "// . ######::'####: ##:::: ##: ##:::::::: ########: ########: //";
echo "// :......:::....::..:::::..::..:::::::::........::........:: //";
echo "// :::'###::::'########::'##::::'##:'####:'##::: ##: //";
echo "// ::'## ##::: ##.... ##: ###::'###:. ##:: ###:: ##: //";
echo "// :'##:. ##:: ##:::: ##: ####'####:: ##:: ####: ##: //";
echo "// '##:::. ##: ##:::: ##: ## ### ##:: ##:: ## ## ##: //";
echo "// #########: ##:::: ##: ##. #: ##:: ##:: ##. ####: //";
echo "// ##.... ##: ##:::: ##: ##:.:: ##:: ##:: ##:. ###: //";
echo "// ##:::: ##: ########:: ##:::: ##:'####: ##::. ##: //";
echo "// ..:::::..::........:::..:::::..::....::..::::..:: //";
echo "// //";
echo "// By iamromulan //";
echo "//////////////////////////////////////////////////////////////////";
echo "==================================================================="
echo "TTYd session file by iamromulan v1.1"
echo "Firmware Revision: $firmware_revision"
echo "Serial Number: $serial_number"
echo "=============================================================="
echo "==================================================================="
# Start a login session
exec /bin/login

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -62,8 +62,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -90,6 +90,28 @@ remount_rw
uninstall_simpleadmin() {
echo "Uninstalling Simpleadmin..."
# Clean up Tailscale if present
if [ -d "/usrdata/tailscale" ]; then
echo "Cleaning up Tailscale..."
# Stop and logout from Tailscale
if [ -f "/usrdata/tailscale/tailscale" ]; then
/usrdata/tailscale/tailscale logout
/usrdata/tailscale/tailscale down
fi
systemctl stop tailscale 2>/dev/null
systemctl stop tailscale-webui 2>/dev/null
rm -f /lib/systemd/system/tailscale.service
# Remove Tailscale files and directories
rm -rf /usrdata/tailscale
rm -f /bin/tailscale
rm -f /bin/tailscaled
# Reload systemd
systemctl daemon-reload
fi
# Check if Lighttpd service is installed and remove it if present
if [ -f "/lib/systemd/system/lighttpd.service" ]; then
echo "Lighttpd detected, uninstalling Lighttpd webserver and its modules..."
@ -209,6 +231,7 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
wget $GITROOT/simpleadmin/www/cgi-bin/user_atcommand
wget $GITROOT/simpleadmin/www/cgi-bin/get_ping
wget $GITROOT/simpleadmin/www/cgi-bin/get_sms
wget $GITROOT/simpleadmin/www/cgi-bin/get_system_stats
wget $GITROOT/simpleadmin/www/cgi-bin/get_ttl_status
wget $GITROOT/simpleadmin/www/cgi-bin/set_ttl
wget $GITROOT/simpleadmin/www/cgi-bin/send_sms

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -58,8 +58,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -55,8 +55,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -46,8 +46,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -64,8 +64,8 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITMAINTREE="main"
GITTREE="beta"
GITMAINTREE="beta"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -101,12 +101,12 @@ install_update_tailscale() {
mkdir -p "$TAILSCALE_DIR" "$TAILSCALE_SYSD_DIR"
echo "Downloading binary files..."
cd /usrdata
curl -O https://pkgs.tailscale.com/stable/tailscale_1.76.1_arm.tgz
tar -xzf tailscale_1.76.1_arm.tgz
rm tailscale_1.76.1_arm.tgz
cd /usrdata/tailscale_1.76.1_arm
curl -O https://pkgs.tailscale.com/stable/tailscale_1.78.1_arm.tgz
tar -xzf tailscale_1.78.1_arm.tgz
rm tailscale_1.78.1_arm.tgz
cd /usrdata/tailscale_1.78.1_arm
mv tailscale tailscaled "$TAILSCALE_DIR/"
rm -rf /usrdata/tailscale_1.76.1_arm
rm -rf /usrdata/tailscale_1.78.1_arm
echo "Downloading systemd files..."
cd "$TAILSCALE_SYSD_DIR"
wget $GITROOT/tailscale/systemd/tailscaled.service

View File

@ -7,7 +7,7 @@ CONFIG_FILE="/usrdata/simpleupdates/simpleupdate.conf"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="main"
GITTREE="beta"
# Monitored directories
DIRECTORIES=("simpleadmin" "socat-at-bridge" "simplefirewall" "tailscale" "ttyd")