Compare commits

..

1 Commits

Author SHA1 Message Date
sky
0974bb2eff 删除 RMxxx_rgmii_toolkit_dev.sh 2024-12-14 04:06:41 +08:00
11 changed files with 575 additions and 667 deletions

View File

@ -51,7 +51,7 @@ Fork development, and PR development to development :)
- If you don't get an error you should be getting replies back endlessly, press `CTRL-C` to stop it. - If you don't get an error you should be getting replies back endlessly, press `CTRL-C` to stop it.
- Simply Copy/Paste this into your Command Prompt/Shell - Simply Copy/Paste this into your Command Prompt/Shell
```bash ```bash
adb shell "cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd / 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 /
``` ```
**Or, if you want to stay in the modems shell when you are done** **Or, if you want to stay in the modems shell when you are done**
@ -61,7 +61,7 @@ adb shell
``` ```
Then run Then run
``` ```
cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / 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 /
``` ```
**You should see:** **You should see:**
![Toolkit](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulantoolkit.png?raw=true) ![Toolkit](https://github.com/iamromulan/quectel-rgmii-configuration-notes/blob/main/images/iamromulantoolkit.png?raw=true)

View File

@ -49,7 +49,7 @@ Fork开发分支并将PR提交到开发分支 :)
- 如果没有错误,您应该会看到持续的回复,按`CTRL-C`停止 - 如果没有错误,您应该会看到持续的回复,按`CTRL-C`停止
- 只需将以下命令复制/粘贴到命令提示符/Shell中 - 只需将以下命令复制/粘贴到命令提示符/Shell中
```bash ```bash
adb shell "cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd / 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 /
``` ```
**或者如果您想在完成后保持在调制解调器的shell中** **或者如果您想在完成后保持在调制解调器的shell中**
@ -59,7 +59,7 @@ adb shell
``` ```
然后运行 然后运行
``` ```
cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / 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 /
``` ```
**您应该看到:** **您应该看到:**

View File

@ -1,42 +1,23 @@
#!/bin/sh #!/bin/sh
#####################################################################
# RMxxx RGMII Toolkit
# Author: iamromulan
# Description: Toolkit for Quectel RMxxx Series modems
# Repository: https://github.com/iamromulan
#####################################################################
#####################################################################
# Environment Configuration
#####################################################################
# Define toolkit paths # Define toolkit paths
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin 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" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
# Format: https://[host]/[user]/[repo]/raw/branch/[branch]/[file] # Gitea 的 raw 文件 URL 格式为: https://[host]/[user]/[repo]/raw/branch/[branch]/[file]
GITROOT="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITTREE" GITROOT="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITTREE"
GITROOTMAIN="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITMAINTREE" GITROOTMAIN="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITMAINTREE"
GITROOTDEV="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITDEVTREE" GITROOTDEV="https://$GITEA_HOST/$GITUSER/$REPONAME/raw/branch/$GITDEVTREE"
#####################################################################
# Directory Configuration
#####################################################################
# System directories
TMP_DIR="/tmp" TMP_DIR="/tmp"
USRDATA_DIR="/usrdata" USRDATA_DIR="/usrdata"
# Application directories
SOCAT_AT_DIR="/usrdata/socat-at-bridge" SOCAT_AT_DIR="/usrdata/socat-at-bridge"
SOCAT_AT_SYSD_DIR="/usrdata/socat-at-bridge/systemd_units" SOCAT_AT_SYSD_DIR="/usrdata/socat-at-bridge/systemd_units"
SIMPLE_ADMIN_DIR="/usrdata/simpleadmin" SIMPLE_ADMIN_DIR="/usrdata/simpleadmin"
@ -45,16 +26,9 @@ SIMPLE_FIREWALL_SCRIPT="$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
SIMPLE_FIREWALL_SYSTEMD_DIR="$SIMPLE_FIREWALL_DIR/systemd" SIMPLE_FIREWALL_SYSTEMD_DIR="$SIMPLE_FIREWALL_DIR/systemd"
TAILSCALE_DIR="/usrdata/tailscale" TAILSCALE_DIR="/usrdata/tailscale"
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd" TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
LIGHTTPD_DIR="/usrdata/lighttpd" # AT Command Script Variables and Functions
# AT Command configuration
DEVICE_FILE="/dev/smd7" DEVICE_FILE="/dev/smd7"
TIMEOUT=4 # Set a timeout for the response TIMEOUT=4 # Set a timeout for the response
#####################################################################
# Basic Utility Functions
#####################################################################
# Function to remount file system as read-write # Function to remount file system as read-write
remount_rw() { remount_rw() {
mount -o remount,rw / mount -o remount,rw /
@ -65,11 +39,7 @@ remount_ro() {
mount -o 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() { start_listening() {
cat "$DEVICE_FILE" > /tmp/device_readout & cat "$DEVICE_FILE" > /tmp/device_readout &
CAT_PID=$! CAT_PID=$!
@ -140,16 +110,12 @@ send_at_commands() {
fi fi
} }
#####################################################################
# Installation and Package Management Functions
#####################################################################
# Check for existing Entware/opkg installation, install if not installed # Check for existing Entware/opkg installation, install if not installed
ensure_entware_installed() { ensure_entware_installed() {
remount_rw remount_rw
if [ ! -f "/opt/bin/opkg" ]; then if [ ! -f "/opt/bin/opkg" ]; then
echo -e "\e[1;32mInstalling Entware/OPKG\e[0m" echo -e "\e[1;32mInstalling Entware/OPKG\e[0m"
cd /tmp && curl -o installentware.sh "$GITROOT/installentware.sh" && chmod +x installentware.sh && ./installentware.sh cd /tmp && wget -O installentware.sh "$GITROOT/installentware.sh" && chmod +x installentware.sh && ./installentware.sh
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo -e "\e[1;31mEntware/OPKG installation failed. Please check your internet connection or the repository URL.\e[0m" echo -e "\e[1;31mEntware/OPKG installation failed. Please check your internet connection or the repository URL.\e[0m"
exit 1 exit 1
@ -219,7 +185,7 @@ ensure_entware_installed() {
fi fi
} }
# Uninstall Entware if the Users chooses #Uninstall Entware if the Users chooses
uninstall_entware() { uninstall_entware() {
echo -e '\033[31mInfo: Starting Entware/OPKG uninstallation...\033[0m' echo -e '\033[31mInfo: Starting Entware/OPKG uninstallation...\033[0m'
@ -252,239 +218,7 @@ uninstall_entware() {
echo -e '\033[32mInfo: Entware/OPKG has been uninstalled successfully.\033[0m' 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
curl -o /usrdata/root/bin/htpasswd "$GITROOT/simpleadmin/htpasswd" && chmod +x /usrdata/root/bin/htpasswd
curl -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
curl -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
curl -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
curl -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() { configure_simple_firewall() {
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" echo -e "\033[0;31mSimplefirewall is not installed, would you like to install it?\033[0m"
@ -576,6 +310,52 @@ configure_simple_firewall() {
echo -e "\e[1;32mFirewall configuration updated.\e[0m" 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 # Function to Uninstall Simpleadmin and dependencies
uninstall_simpleadmin_components() { uninstall_simpleadmin_components() {
echo -e "\e[1;32mStarting the uninstallation process for Simpleadmin components.\e[0m" echo -e "\e[1;32mStarting the uninstallation process for Simpleadmin components.\e[0m"
@ -672,10 +452,6 @@ uninstall_simpleadmin_components() {
echo "Uninstallation process completed." echo "Uninstallation process completed."
} }
#####################################################################
# Tailscale Management Functions
#####################################################################
# Function for Tailscale Submenu # Function for Tailscale Submenu
tailscale_menu() { tailscale_menu() {
while true; do while true; do
@ -696,13 +472,13 @@ tailscale_menu() {
done done
} }
# Function to install or update Tailscale # Function to install, update, or remove Tailscale
install_update_tailscale() { install_update_tailscale() {
echo -e "\e[1;31m2) Installing tailscale from the $GITTREE branch\e[0m" echo -e "\e[1;31m2) Installing tailscale from the $GITTREE branch\e[0m"
ensure_entware_installed ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1 mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1 mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
curl -o /usrdata/simpleupdates/scripts/update_tailscale.sh "$GITROOT/simpleupdates/scripts/update_tailscale.sh" && chmod +x /usrdata/simpleupdates/scripts/update_tailscale.sh wget -O /usrdata/simpleupdates/scripts/update_tailscale.sh $GITROOT/simpleupdates/scripts/update_tailscale.sh && chmod +x /usrdata/simpleupdates/scripts/update_tailscale.sh
echo -e "\e[1;32mInstalling/updating: Tailscale\e[0m" echo -e "\e[1;32mInstalling/updating: Tailscale\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m" echo -e "\e[1;32mPlease Wait....\e[0m"
remount_rw remount_rw
@ -759,8 +535,8 @@ configure_tailscale() {
1) 1)
remount_rw remount_rw
cd /lib/systemd/system/ cd /lib/systemd/system/
curl -o tailscale-webui.service "$GITROOT/tailscale/systemd/tailscale-webui.service" wget -O tailscale-webui.service $GITROOT/tailscale/systemd/tailscale-webui.service
curl -o tailscale-webui-trigger.service "$GITROOT/tailscale/systemd/tailscale-webui-trigger.service" wget -O tailscale-webui-trigger.service $GITROOT/tailscale/systemd/tailscale-webui-trigger.service
ln -sf /lib/systemd/system/tailscale-webui-trigger.service /lib/systemd/system/multi-user.target.wants/ ln -sf /lib/systemd/system/tailscale-webui-trigger.service /lib/systemd/system/multi-user.target.wants/
systemctl daemon-reload systemctl daemon-reload
echo "Tailscale Web UI Enabled" echo "Tailscale Web UI Enabled"
@ -792,11 +568,184 @@ configure_tailscale() {
done done
} }
##################################################################### # Function to manage Daily Reboot Timer
# Tool Installation Functions 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
}
# Function to install OpenSSH Server
install_sshd() { install_sshd() {
if [ -d "/usrdata/sshd" ]; then if [ -d "/usrdata/sshd" ]; then
echo -e "\e[1;31mSSHD is currently installed.\e[0m" echo -e "\e[1;31mSSHD is currently installed.\e[0m"
@ -808,14 +757,6 @@ install_sshd() {
case $sshd_choice in case $sshd_choice in
1) 1)
echo -e "\e[1;31m2) Installing sshd from the $GITTREE branch\e[0m" 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
curl -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) 2)
echo -e "\e[1;31mUninstalling SSHD...\e[0m" echo -e "\e[1;31mUninstalling SSHD...\e[0m"
@ -832,133 +773,56 @@ install_sshd() {
esac esac
fi fi
# Proceed with installation if not installed # Proceed with installation or updating if not uninstalling
ensure_entware_installed ensure_entware_installed
mkdir /usrdata/simpleupdates > /dev/null 2>&1 mkdir /usrdata/simpleupdates > /dev/null 2>&1
mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1 mkdir /usrdata/simpleupdates/scripts > /dev/null 2>&1
curl -o /usrdata/simpleupdates/scripts/update_sshd.sh "$GITROOT/simpleupdates/scripts/update_sshd.sh" && chmod +x /usrdata/simpleupdates/scripts/update_sshd.sh 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: SSHd\e[0m" echo -e "\e[1;32mInstalling/updating: SSHd\e[0m"
echo -e "\e[1;32mPlease Wait....\e[0m" echo -e "\e[1;32mPlease Wait....\e[0m"
/usrdata/simpleupdates/scripts/update_sshd.sh /usrdata/simpleupdates/scripts/update_sshd.sh
echo -e "\e[1;32m SSHd has been installed.\e[0m" echo -e "\e[1;32m SSHd has been updated/installed.\e[0m"
} }
# 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
mkdir /usrdata/root
mkdir /usrdata/root/bin
cd /usrdata/root/bin
curl -O https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-armhf.tgz
tar -xzf ookla-speedtest-1.2.0-linux-armhf.tgz
rm ookla-speedtest-1.2.0-linux-armhf.tgz
rm speedtest.md
cd /
ln -sf /usrdata/root/bin/speedtest /bin
remount_ro
echo -e "\e[1;32mSpeedtest CLI (speedtest command) installed!!\e[0m"
echo -e "\e[1;32mTry running the command 'speedtest'\e[0m"
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"
}
# Function to install Fast.com CLI # Main menu
install_fast_cli() {
echo -e "\e[1;32mInstalling fast.com CLI (fast command)\e[0m"
remount_rw
mkdir /usrdata/root
mkdir /usrdata/root/bin
cd /usrdata/root/bin
curl -o fast "https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/tools/fast_linux_arm" && chmod +x fast
cd /
ln -sf /usrdata/root/bin/fast /bin
remount_ro
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"
}
##################################################################### ARCH=$(uname -a)
# AT Command Bridge Functions 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 /
# 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
curl -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
curl -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 && curl -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 exit 0
elif echo "$ARCH" | grep -q "armv7l"; then elif echo "$ARCH" | grep -q "armv7l"; then
# Continue if architecture is armv7l # Continue if architecture is armv7l
echo "Architecture is armv7l, continuing..." echo "Architecture is armv7l, continuing..."
else else
uname -a uname -a
echo "Unsupported architecture." echo "Unsupported architecture."
exit 1 exit 1
fi fi
}
# Display the main menu while true; do
display_main_menu() { 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 "// By iamromulan //" echo "//////////////////////////////////////////////////////////////////";
echo "//////////////////////////////////////////////////////////////////"
echo -e "\e[92m" echo -e "\e[92m"
echo "Welcome to iamromulan's RGMII Toolkit script for Quectel RMxxx Series modems!" echo "Welcome to iamromulan's RGMII Toolkit script for Quectel RMxxx Series modems!"
@ -974,32 +838,42 @@ display_main_menu() {
echo -e "\e[95m6) Simple Firewall Management\e[0m" # Light Purple echo -e "\e[95m6) Simple Firewall Management\e[0m" # Light Purple
echo -e "\e[94m7) Tailscale Management\e[0m" # Light Blue 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[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[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[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[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[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[92m13) Install OpenSSH Server\e[0m" # Light Green
echo -e "\e[93m14) Exit\e[0m" # Yellow echo -e "\e[93m14) Exit\e[0m" # Yellow (repeated color for exit option)
}
# Main program loop
main() {
check_architecture
while true; do
display_main_menu
read -p "Enter your choice: " choice read -p "Enter your choice: " choice
case $choice in case $choice in
1) send_at_commands;; 1)
2) install_simple_admin;; send_at_commands
3) set_simpleadmin_passwd;; ;;
4) set_root_passwd;; 2)
5) uninstall_simpleadmin_components;; install_simple_admin
6) configure_simple_firewall;; ;;
7) tailscale_menu;; 3) set_simpleadmin_passwd
8) manage_reboot_timer;; ;;
9) manage_cfun_fix;; 4)
set_root_passwd
;;
5)
uninstall_simpleadmin_components
;;
6)
configure_simple_firewall
;;
7)
tailscale_menu
;;
8)
manage_reboot_timer
;;
9)
manage_cfun_fix
;;
10) 10)
echo -e "\033[31mAre you sure you want to uninstall entware?\033[0m" echo -e "\033[31mAre you sure you want to uninstall entware?\033[0m"
echo -e "\033[31m1) Yes\033[0m" echo -e "\033[31m1) Yes\033[0m"
@ -1008,22 +882,60 @@ main() {
case $user_choice in case $user_choice in
1) 1)
# If yes, uninstall existing entware
echo -e "\033[31mUninstalling existing entware...\033[0m" echo -e "\033[31mUninstalling existing entware...\033[0m"
uninstall_entware uninstall_entware # Assuming uninstall_entware is a defined function or command
echo -e "\033[31mEntware has been uninstalled.\033[0m" echo -e "\033[31mEntware has been uninstalled.\033[0m"
;; ;;
2) 2)
# If no, exit the script
echo -e "\033[31mUninstallation cancelled.\033[0m" echo -e "\033[31mUninstallation cancelled.\033[0m"
exit 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" echo -e "\033[31mInvalid option. Please select 1 or 2.\033[0m"
;; ;;
esac esac
;; ;;
11) install_speedtest_cli;;
12) install_fast_cli;; 11)
13) install_sshd;; ensure_entware_installed
echo -e "\e[1;32mInstalling Speedtest.net CLI (speedtest command)\e[0m"
remount_rw
mkdir /usrdata/root
mkdir /usrdata/root/bin
cd /usrdata/root/bin
wget https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-armhf.tgz
tar -xzf ookla-speedtest-1.2.0-linux-armhf.tgz
rm ookla-speedtest-1.2.0-linux-armhf.tgz
rm speedtest.md
cd /
ln -sf /usrdata/root/bin/speedtest /bin
remount_ro
echo -e "\e[1;32mSpeedtest CLI (speedtest command) installed!!\e[0m"
echo -e "\e[1;32mTry running the command 'speedtest'\e[0m"
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)
echo -e "\e[1;32mInstalling fast.com CLI (fast command)\e[0m"
remount_rw
mkdir /usrdata/root
mkdir /usrdata/root/bin
cd /usrdata/root/bin
wget -O fast https://code.060070.xyz/sky/simple-admin/raw/branch/main/tools/fast_linux_arm && chmod +x fast
cd /
ln -sf /usrdata/root/bin/fast /bin
remount_ro
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"
;;
13)
install_sshd
;;
14) 14)
echo -e "\e[1;32mGoodbye!\e[0m" echo -e "\e[1;32mGoodbye!\e[0m"
break break
@ -1032,8 +944,4 @@ main() {
echo -e "\e[1;31mInvalid option\e[0m" echo -e "\e[1;31mInvalid option\e[0m"
;; ;;
esac esac
done done
}
# Start the program
main

View File

@ -80,9 +80,9 @@ done
echo -e '\033[32mInfo: Opkg package manager deployment...\033[0m' echo -e '\033[32mInfo: Opkg package manager deployment...\033[0m'
URL=http://bin.entware.net/${ARCH}/installer URL=http://bin.entware.net/${ARCH}/installer
curl -o /opt/bin/opkg "$URL/opkg" wget $URL/opkg -O /opt/bin/opkg
chmod 755 /opt/bin/opkg chmod 755 /opt/bin/opkg
curl -o /opt/etc/opkg.conf "$URL/opkg.conf" wget $URL/opkg.conf -O /opt/etc/opkg.conf
echo -e '\033[32mInfo: Basic packages installation...\033[0m' echo -e '\033[32mInfo: Basic packages installation...\033[0m'
/opt/bin/opkg update /opt/bin/opkg update

View File

@ -34,8 +34,8 @@ toolkit_menu() {
read -p "Select an option (1-3): " option read -p "Select an option (1-3): " option
case "$option" in case "$option" in
1) cd /tmp && curl -o RMxxx_rgmii_toolkit.sh "https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh" && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;; 1) 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 / ;;
2) cd /tmp && curl -o RMxxx_rgmii_toolkit.sh "https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh" && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;; 2) 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 / ;;
3) break ;; 3) break ;;
*) echo "Invalid option. Please try again." ;; *) echo "Invalid option. Please try again." ;;
esac esac

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -62,8 +62,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -158,8 +158,8 @@ install_lighttpd() {
systemctl stop lighttpd systemctl stop lighttpd
echo -e "\033[0;32mInstalling/Updating Lighttpd...\033[0m" echo -e "\033[0;32mInstalling/Updating Lighttpd...\033[0m"
mkdir -p "$SIMPLE_ADMIN_DIR" mkdir -p "$SIMPLE_ADMIN_DIR"
curl -o "$SIMPLE_ADMIN_DIR/lighttpd.conf" "$GITROOT/simpleadmin/lighttpd.conf" wget -O "$SIMPLE_ADMIN_DIR/lighttpd.conf" $GITROOT/simpleadmin/lighttpd.conf
curl -o "/lib/systemd/system/lighttpd.service" "$GITROOT/simpleadmin/systemd/lighttpd.service" wget -O "/lib/systemd/system/lighttpd.service" $GITROOT/simpleadmin/systemd/lighttpd.service
ln -sf "/lib/systemd/system/lighttpd.service" "/lib/systemd/system/multi-user.target.wants/" ln -sf "/lib/systemd/system/lighttpd.service" "/lib/systemd/system/multi-user.target.wants/"
echo "www-data ALL = (root) NOPASSWD: /usr/sbin/iptables, /usr/sbin/ip6tables, /usrdata/simplefirewall/ttl-override, /bin/echo, /bin/cat" > /opt/etc/sudoers.d/www-data echo "www-data ALL = (root) NOPASSWD: /usr/sbin/iptables, /usr/sbin/ip6tables, /usrdata/simplefirewall/ttl-override, /bin/echo, /bin/cat" > /opt/etc/sudoers.d/www-data
@ -187,58 +187,58 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
mkdir $SIMPLE_ADMIN_DIR/www/css mkdir $SIMPLE_ADMIN_DIR/www/css
mkdir $SIMPLE_ADMIN_DIR/www/js mkdir $SIMPLE_ADMIN_DIR/www/js
cd $SIMPLE_ADMIN_DIR/systemd cd $SIMPLE_ADMIN_DIR/systemd
curl -o lighttpd.service "$GITROOT/simpleadmin/systemd/lighttpd.service" wget $GITROOT/simpleadmin/systemd/lighttpd.service
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/script cd $SIMPLE_ADMIN_DIR/script
curl -o ttl_script.sh "$GITROOT/simpleadmin/script/ttl_script.sh" wget $GITROOT/simpleadmin/script/ttl_script.sh
curl -o remove_watchcat.sh "$GITROOT/simpleadmin/script/remove_watchcat.sh" wget $GITROOT/simpleadmin/script/remove_watchcat.sh
curl -o create_watchcat.sh "$GITROOT/simpleadmin/script/create_watchcat.sh" wget $GITROOT/simpleadmin/script/create_watchcat.sh
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/console cd $SIMPLE_ADMIN_DIR/console
curl -o .profile "$GITROOT/simpleadmin/console/.profile" wget $GITROOT/simpleadmin/console/.profile
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/console/menu cd $SIMPLE_ADMIN_DIR/console/menu
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh" wget $GITROOT/simpleadmin/console/menu/start_menu.sh
ln -f $SIMPLE_ADMIN_DIR/console/menu/start_menu.sh /usrdata/root/bin/menu ln -f $SIMPLE_ADMIN_DIR/console/menu/start_menu.sh /usrdata/root/bin/menu
curl -o sfirewall_settings.sh "$GITROOT/simpleadmin/console/menu/sfirewall_settings.sh" wget $GITROOT/simpleadmin/console/menu/sfirewall_settings.sh
curl -o LAN_settings.sh "$GITROOT/simpleadmin/console/menu/LAN_settings.sh" wget $GITROOT/simpleadmin/console/menu/LAN_settings.sh
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh" wget $GITROOT/simpleadmin/console/menu/start_menu.sh
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/www cd $SIMPLE_ADMIN_DIR/www
curl -o deviceinfo.html "$GITROOT/simpleadmin/www/deviceinfo.html" wget $GITROOT/simpleadmin/www/deviceinfo.html
curl -o favicon.ico "$GITROOT/simpleadmin/www/favicon.ico" wget $GITROOT/simpleadmin/www/favicon.ico
curl -o index.html "$GITROOT/simpleadmin/www/index.html" wget $GITROOT/simpleadmin/www/index.html
curl -o network.html "$GITROOT/simpleadmin/www/network.html" wget $GITROOT/simpleadmin/www/network.html
curl -o settings.html "$GITROOT/simpleadmin/www/settings.html" wget $GITROOT/simpleadmin/www/settings.html
curl -o sms.html "$GITROOT/simpleadmin/www/sms.html" wget $GITROOT/simpleadmin/www/sms.html
curl -o scanner.html "$GITROOT/simpleadmin/www/scanner.html" wget $GITROOT/simpleadmin/www/scanner.html
curl -o watchcat.html "$GITROOT/simpleadmin/www/watchcat.html" wget $GITROOT/simpleadmin/www/watchcat.html
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/www/js cd $SIMPLE_ADMIN_DIR/www/js
curl -o alpinejs.min.js "$GITROOT/simpleadmin/www/js/alpinejs.min.js" wget $GITROOT/simpleadmin/www/js/alpinejs.min.js
curl -o bootstrap.bundle.min.js "$GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js" wget $GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js
curl -o dark-mode.js "$GITROOT/simpleadmin/www/js/dark-mode.js" wget $GITROOT/simpleadmin/www/js/dark-mode.js
curl -o generate-freq-box.js "$GITROOT/simpleadmin/www/js/generate-freq-box.js" wget $GITROOT/simpleadmin/www/js/generate-freq-box.js
curl -o parse-settings.js "$GITROOT/simpleadmin/www/js/parse-settings.js" wget $GITROOT/simpleadmin/www/js/parse-settings.js
curl -o populate-checkbox.js "$GITROOT/simpleadmin/www/js/populate-checkbox.js" wget $GITROOT/simpleadmin/www/js/populate-checkbox.js
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/www/css cd $SIMPLE_ADMIN_DIR/www/css
curl -o bootstrap.min.css "$GITROOT/simpleadmin/www/css/bootstrap.min.css" wget $GITROOT/simpleadmin/www/css/bootstrap.min.css
curl -o styles.css "$GITROOT/simpleadmin/www/css/styles.css" wget $GITROOT/simpleadmin/www/css/styles.css
sleep 1 sleep 1
cd $SIMPLE_ADMIN_DIR/www/cgi-bin cd $SIMPLE_ADMIN_DIR/www/cgi-bin
curl -o get_atcommand "$GITROOT/simpleadmin/www/cgi-bin/get_atcommand" wget $GITROOT/simpleadmin/www/cgi-bin/get_atcommand
curl -o user_atcommand "$GITROOT/simpleadmin/www/cgi-bin/user_atcommand" wget $GITROOT/simpleadmin/www/cgi-bin/user_atcommand
curl -o get_ping "$GITROOT/simpleadmin/www/cgi-bin/get_ping" wget $GITROOT/simpleadmin/www/cgi-bin/get_ping
curl -o get_sms "$GITROOT/simpleadmin/www/cgi-bin/get_sms" wget $GITROOT/simpleadmin/www/cgi-bin/get_sms
curl -o get_system_stats "$GITROOT/simpleadmin/www/cgi-bin/get_system_stats" wget $GITROOT/simpleadmin/www/cgi-bin/get_system_stats
curl -o get_ttl_status "$GITROOT/simpleadmin/www/cgi-bin/get_ttl_status" wget $GITROOT/simpleadmin/www/cgi-bin/get_ttl_status
curl -o set_ttl "$GITROOT/simpleadmin/www/cgi-bin/set_ttl" wget $GITROOT/simpleadmin/www/cgi-bin/set_ttl
curl -o send_sms "$GITROOT/simpleadmin/www/cgi-bin/send_sms" wget $GITROOT/simpleadmin/www/cgi-bin/send_sms
curl -o get_uptime "$GITROOT/simpleadmin/www/cgi-bin/get_uptime" wget $GITROOT/simpleadmin/www/cgi-bin/get_uptime
curl -o get_watchcat_status "$GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status" wget $GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status
curl -o set_watchcat "$GITROOT/simpleadmin/www/cgi-bin/set_watchcat" wget $GITROOT/simpleadmin/www/cgi-bin/set_watchcat
curl -o watchcat_maker "$GITROOT/simpleadmin/www/cgi-bin/watchcat_maker" wget $GITROOT/simpleadmin/www/cgi-bin/watchcat_maker
sleep 1 sleep 1
cd / cd /
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/* chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
@ -255,10 +255,10 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
install_ttyd() { 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/console cd $SIMPLE_ADMIN_DIR/console
curl -L -o ttyd https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/tools/ttyd.armhf && chmod +x ttyd curl -L -o ttyd https://code.060070.xyz/sky/simple-admin/raw/branch/main/tools/ttyd.armhf && chmod +x ttyd
curl -o ttyd.bash "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash wget "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
cd $SIMPLE_ADMIN_DIR/systemd/ cd $SIMPLE_ADMIN_DIR/systemd/
curl -o ttyd.service "$GITROOT/simpleadmin/systemd/ttyd.service" wget "$GITROOT/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

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -58,8 +58,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -102,14 +102,14 @@ install_simple_firewall() {
mount -o remount,rw / mount -o remount,rw /
mkdir -p "$SIMPLE_FIREWALL_DIR" mkdir -p "$SIMPLE_FIREWALL_DIR"
mkdir -p "$SIMPLE_FIREWALL_SYSTEMD_DIR" mkdir -p "$SIMPLE_FIREWALL_SYSTEMD_DIR"
curl -o "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" "$GITROOT/simplefirewall/simplefirewall.sh" wget -O "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" $GITROOT/simplefirewall/simplefirewall.sh
curl -o "$SIMPLE_FIREWALL_DIR/ttl-override" "$GITROOT/simplefirewall/ttl-override" wget -O "$SIMPLE_FIREWALL_DIR/ttl-override" $GITROOT/simplefirewall/ttl-override
curl -o "$SIMPLE_FIREWALL_DIR/ttlvalue" "$GITROOT/simplefirewall/ttlvalue" wget -O "$SIMPLE_FIREWALL_DIR/ttlvalue" $GITROOT/simplefirewall/ttlvalue
chmod 666 $SIMPLE_FIREWALL_DIR/ttlvalue chmod 666 $SIMPLE_FIREWALL_DIR/ttlvalue
chmod +x "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" chmod +x "$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
chmod +x "$SIMPLE_FIREWALL_DIR/ttl-override" chmod +x "$SIMPLE_FIREWALL_DIR/ttl-override"
curl -o "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" "$GITROOT/simplefirewall/systemd/simplefirewall.service" wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" $GITROOT/simplefirewall/systemd/simplefirewall.service
curl -o "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" "$GITROOT/simplefirewall/systemd/ttl-override.service" wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" $GITROOT/simplefirewall/systemd/ttl-override.service
cp -rf $SIMPLE_FIREWALL_SYSTEMD_DIR/* /lib/systemd/system cp -rf $SIMPLE_FIREWALL_SYSTEMD_DIR/* /lib/systemd/system
ln -sf "/lib/systemd/system/simplefirewall.service" "/lib/systemd/system/multi-user.target.wants/" ln -sf "/lib/systemd/system/simplefirewall.service" "/lib/systemd/system/multi-user.target.wants/"
ln -sf "/lib/systemd/system/ttl-override.service" "/lib/systemd/system/multi-user.target.wants/" ln -sf "/lib/systemd/system/ttl-override.service" "/lib/systemd/system/multi-user.target.wants/"

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -55,8 +55,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -110,18 +110,18 @@ install_at_socat() {
mkdir $SOCAT_AT_DIR mkdir $SOCAT_AT_DIR
cd $SOCAT_AT_DIR cd $SOCAT_AT_DIR
mkdir $SOCAT_AT_SYSD_DIR mkdir $SOCAT_AT_SYSD_DIR
curl -O "$GITROOT/socat-at-bridge/socat-armel-static" wget $GITROOT/socat-at-bridge/socat-armel-static
curl -O "$GITROOT/socat-at-bridge/killsmd7bridge" wget $GITROOT/socat-at-bridge/killsmd7bridge
curl -O "$GITROOT/socat-at-bridge/atcmd" wget $GITROOT/socat-at-bridge/atcmd
curl -O "$GITROOT/socat-at-bridge/atcmd11" wget $GITROOT/socat-at-bridge/atcmd11
cd $SOCAT_AT_SYSD_DIR cd $SOCAT_AT_SYSD_DIR
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-killsmd7bridge.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-killsmd7bridge.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7.service" wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7.service
# Set execute permissions # Set execute permissions
cd $SOCAT_AT_DIR cd $SOCAT_AT_DIR

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -46,8 +46,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -62,7 +62,7 @@ echo -e "\e[1;32mOpenSSH Server\e[0m"
remount_rw remount_rw
mkdir /usrdata/sshd mkdir /usrdata/sshd
curl -o /lib/systemd/system/sshd.service "$GITROOT/sshd/sshd.service" wget -O /lib/systemd/system/sshd.service "$GITROOT/sshd/sshd.service"
ln -sf "/lib/systemd/system/sshd.service" "/lib/systemd/system/multi-user.target.wants/" ln -sf "/lib/systemd/system/sshd.service" "/lib/systemd/system/multi-user.target.wants/"
opkg install openssh-server-pam opkg install openssh-server-pam

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # 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" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
GITMAINTREE="beta-curl" GITMAINTREE="beta"
GITDEVTREE="dev" GITDEVTREE="dev"
# Construct Gitea URLs # Construct Gitea URLs
@ -109,8 +109,8 @@ install_update_tailscale() {
rm -rf /usrdata/tailscale_1.78.1_arm rm -rf /usrdata/tailscale_1.78.1_arm
echo "Downloading systemd files..." echo "Downloading systemd files..."
cd "$TAILSCALE_SYSD_DIR" cd "$TAILSCALE_SYSD_DIR"
curl -O "$GITROOT/tailscale/systemd/tailscaled.service" wget $GITROOT/tailscale/systemd/tailscaled.service
curl -O "$GITROOT/tailscale/systemd/tailscaled.defaults" wget $GITROOT/tailscale/systemd/tailscaled.defaults
sleep 2s sleep 2s
echo "Setting Permissions..." echo "Setting Permissions..."
chmod +x "$TAILSCALE_DIR/tailscaled" "$TAILSCALE_DIR/tailscale" chmod +x "$TAILSCALE_DIR/tailscaled" "$TAILSCALE_DIR/tailscale"

View File

@ -7,7 +7,7 @@ CONFIG_FILE="/usrdata/simpleupdates/simpleupdate.conf"
GITEA_HOST="code.060070.xyz" GITEA_HOST="code.060070.xyz"
GITUSER="sky" GITUSER="sky"
REPONAME="simple-admin" REPONAME="simple-admin"
GITTREE="beta-curl" GITTREE="beta"
# Monitored directories # Monitored directories
DIRECTORIES=("simpleadmin" "socat-at-bridge" "simplefirewall" "tailscale" "ttyd") DIRECTORIES=("simpleadmin" "socat-at-bridge" "simplefirewall" "tailscale" "ttyd")
@ -36,7 +36,7 @@ trim_log_file() {
check_for_updates() { check_for_updates() {
echo "$(date): Checking for updates..." echo "$(date): Checking for updates..."
for dir in "${DIRECTORIES[@]}"; do for dir in "${DIRECTORIES[@]}"; do
local remote_rev=$(curl -s "$BASE_URL/$dir/.rev") local remote_rev=$(wget -qO- "$BASE_URL/$dir/.rev")
local local_rev_file="/usrdata/$dir/.rev" local local_rev_file="/usrdata/$dir/.rev"
if [[ ! -f "$local_rev_file" ]]; then if [[ ! -f "$local_rev_file" ]]; then
@ -48,7 +48,7 @@ check_for_updates() {
if [[ "$remote_rev" -gt "$local_rev" ]]; then if [[ "$remote_rev" -gt "$local_rev" ]]; then
echo "Update available for $dir, updating..." echo "Update available for $dir, updating..."
curl -so "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh" wget -qO "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
chmod +x "/tmp/update_${dir}.sh" chmod +x "/tmp/update_${dir}.sh"
"/tmp/update_${dir}.sh" "/tmp/update_${dir}.sh"
else else
@ -127,7 +127,7 @@ fi
force_check_for_updates() { force_check_for_updates() {
echo "$(date): Checking for updates..." echo "$(date): Checking for updates..."
for dir in "${DIRECTORIES[@]}"; do for dir in "${DIRECTORIES[@]}"; do
local remote_rev=$(curl -s "$BASE_URL/$dir/.rev") local remote_rev=$(wget -qO- "$BASE_URL/$dir/.rev")
local local_rev_file="/usrdata/$dir/.rev" local local_rev_file="/usrdata/$dir/.rev"
if [[ ! -f "$local_rev_file" ]]; then if [[ ! -f "$local_rev_file" ]]; then
@ -139,7 +139,7 @@ force_check_for_updates() {
if [[ "$remote_rev" -gt "$local_rev" ]]; then if [[ "$remote_rev" -gt "$local_rev" ]]; then
echo "Update available for $dir, updating..." echo "Update available for $dir, updating..."
curl -so "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh" wget -qO "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
chmod +x "/tmp/update_${dir}.sh" chmod +x "/tmp/update_${dir}.sh"
"/tmp/update_${dir}.sh" "/tmp/update_${dir}.sh"
else else