Merge branch 'development' into development-socat
This commit is contained in:
@@ -13,7 +13,7 @@ SIMPLE_ADMIN_DIR="/usrdata/simpleadmin"
|
|||||||
SIMPLE_FIREWALL_DIR="/usrdata/simplefirewall"
|
SIMPLE_FIREWALL_DIR="/usrdata/simplefirewall"
|
||||||
SIMPLE_FIREWALL_SCRIPT="$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
|
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"
|
||||||
# AT Command Script Variables and Functions
|
# AT Command Script Variables and Functions
|
||||||
DEVICE_FILE="/dev/smd7"
|
DEVICE_FILE="/dev/smd7"
|
||||||
@@ -526,7 +526,7 @@ configure_tailscale() {
|
|||||||
remount_ro
|
remount_ro
|
||||||
;;
|
;;
|
||||||
3) $TAILSCALE_DIR/tailscale up --accept-dns=false --reset;;
|
3) $TAILSCALE_DIR/tailscale up --accept-dns=false --reset;;
|
||||||
4) $TAILSCALE_DIR/tailscale up --ssh --accept-dns=false --reset;;
|
4) $TAILSCALE_DIR/tailscale up --ssh --accept-dns=false --reset;;
|
||||||
5) $TAILSCALE_DIR/tailscale up --accept-dns=false --reset;;
|
5) $TAILSCALE_DIR/tailscale up --accept-dns=false --reset;;
|
||||||
6) $TAILSCALE_DIR/tailscale down;;
|
6) $TAILSCALE_DIR/tailscale down;;
|
||||||
7) $TAILSCALE_DIR/tailscale logout;;
|
7) $TAILSCALE_DIR/tailscale logout;;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#Path
|
#Path
|
||||||
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
|
||||||
|
|
||||||
#Post-login execution
|
#Post-login execution
|
||||||
start_menu.sh
|
/usrdata/simpleadmin/console/menu/start_menu.sh
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Define executable files path
|
# Define executable files path
|
||||||
EXE=/usrdata/root/bin
|
|
||||||
MENU_SH=/usrdata/simpleadmin/console/menu
|
MENU_SH=/usrdata/simpleadmin/console/menu
|
||||||
|
|
||||||
# Display Messages in Colors
|
# Display Messages in Colors
|
||||||
@@ -23,79 +22,53 @@ display_red() {
|
|||||||
|
|
||||||
# Menus
|
# Menus
|
||||||
|
|
||||||
toolkit() {
|
toolkit_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
display_green "Welcome to iamromulan's Simple Console Menu"
|
display_green "Run a Toolkit version"
|
||||||
display_green "Select an option:"
|
display_green "Select an option:"
|
||||||
echo "------------------"
|
echo "------------------"
|
||||||
display_green "1. LAN Settings"
|
display_green "1. Get and run the Toolkit"
|
||||||
display_green "2. Change simpleadmin (admin) password"
|
display_red "2. Get and run the Development/unstable Toolkit"
|
||||||
display_green "3. Change root password (shell/ssh/console)"
|
display_red "3. Exit (Enter Root Shell)"
|
||||||
display_green "4. Open File Browser/Editor (mc)"
|
echo
|
||||||
display_green "5. View Used/Available space"
|
read -p "Select an option (1-11): " option
|
||||||
display_green "6. Open Task Manager/View CPU Load"
|
|
||||||
display_green "7. Run speedtest.net test"
|
case "$option" in
|
||||||
display_green "8. Run fast.com test (30Mbps max)"
|
1) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
display_green "9. Get and run the Toolkit"
|
2) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||||
display_green "10. Get and run the Development/unstable Toolkit"
|
3) break ;;
|
||||||
display_green "11. Exit (Enter Root Shell)"
|
*) echo "Invalid option. Please try again." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
apps_menu() {
|
||||||
|
while true; do
|
||||||
|
display_green "Run a modem App"
|
||||||
|
display_green "Select an option:"
|
||||||
|
echo "------------------"
|
||||||
|
display_random_color "1. Open File Browser/Editor (mc)"
|
||||||
|
display_random_color "2. View Used/Available space"
|
||||||
|
display_random_color "3. Open Task Manager/View CPU Load"
|
||||||
|
display_random_color "4. Run speedtest.net test"
|
||||||
|
display_random_color "5. Run fast.com test (30Mbps max)"
|
||||||
|
display_red "6. Go Back"
|
||||||
echo
|
echo
|
||||||
read -p "Select an option (1-11): " option
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
1) $MEU/LAN_settings ;;
|
|
||||||
2) $EXE/simplepasswd ;;
|
|
||||||
3) passwd ;;
|
|
||||||
4) mc ;;
|
4) mc ;;
|
||||||
5) dfc ;;
|
5) dfc ;;
|
||||||
6) htop ;;
|
6) htop ;;
|
||||||
7) $EXE/speedtest ;;
|
7) speedtest ;;
|
||||||
8) $EXE/fast ;;
|
8) fast ;;
|
||||||
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
11) break ;;
|
11) break ;;
|
||||||
*) echo "Invalid option. Please try again." ;;
|
*) echo "Invalid option. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
apps() {
|
settings_menu() {
|
||||||
while true; do
|
|
||||||
display_green "Welcome to iamromulan's Simple Console Menu"
|
|
||||||
display_green "Select an option:"
|
|
||||||
echo "------------------"
|
|
||||||
display_green "1. LAN Settings"
|
|
||||||
display_green "2. Change simpleadmin (admin) password"
|
|
||||||
display_green "3. Change root password (shell/ssh/console)"
|
|
||||||
display_green "4. Open File Browser/Editor (mc)"
|
|
||||||
display_green "5. View Used/Available space"
|
|
||||||
display_green "6. Open Task Manager/View CPU Load"
|
|
||||||
display_green "7. Run speedtest.net test"
|
|
||||||
display_green "8. Run fast.com test (30Mbps max)"
|
|
||||||
display_green "9. Get and run the Toolkit"
|
|
||||||
display_green "10. Get and run the Development/unstable Toolkit"
|
|
||||||
display_green "11. Exit (Enter Root Shell)"
|
|
||||||
echo
|
|
||||||
read -p "Select an option (1-11): " option
|
|
||||||
|
|
||||||
case "$option" in
|
|
||||||
1) $menu_sh/LAN_settings ;;
|
|
||||||
2) $EXE/simplepasswd ;;
|
|
||||||
3) passwd ;;
|
|
||||||
4) mc ;;
|
|
||||||
5) dfc ;;
|
|
||||||
6) htop ;;
|
|
||||||
7) $EXE/speedtest ;;
|
|
||||||
8) $EXE/fast ;;
|
|
||||||
9) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
10) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/development/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
|
||||||
11) break ;;
|
|
||||||
*) echo "Invalid option. Please try again." ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
settings() {
|
|
||||||
while true; do
|
while true; do
|
||||||
display_green "Welcome to iamromulan's Simple Console Menu"
|
display_green "Welcome to iamromulan's Simple Console Menu"
|
||||||
display_green "Select an option:"
|
display_green "Select an option:"
|
||||||
@@ -131,9 +104,9 @@ main_menu() {
|
|||||||
read -p "Select an option (1-11): " option
|
read -p "Select an option (1-11): " option
|
||||||
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
1) apps ;;
|
1) apps_menu ;;
|
||||||
2) settings ;;
|
2) settings_menu ;;
|
||||||
3) toolkit ;;
|
3) toolkit_menu ;;
|
||||||
4) break ;;
|
4) break ;;
|
||||||
*) echo "Invalid option. Please try again." ;;
|
*) echo "Invalid option. Please try again." ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -51,10 +51,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/sms.html">SMS</a>
|
<a class="nav-link" href="/sms.html">SMS</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
<a
|
||||||
class="nav-link active"
|
class="nav-link active"
|
||||||
href="/deviceinfo.html"
|
href="/deviceinfo.html"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/sms.html">SMS</a>
|
<a class="nav-link" href="/sms.html">SMS</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<!-- change to a much simpler tab title -->
|
<!-- change to a much simpler tab title -->
|
||||||
<title>Simple Admin</title>
|
<title>Logging out...</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/bulma.css" />
|
<link rel="stylesheet" href="css/bulma.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="css/admin.css" />
|
<link rel="stylesheet" type="text/css" href="css/admin.css" />
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<nav class="navbar is-black" x-data="{ isOpen: false }">
|
<nav class="navbar is-black" x-data="{ isOpen: false }">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<a class="navbar-item brand-text" href="/"> Simple Admin </a>
|
<a class="navbar-item brand-text" href="/"> Logging Out... </a>
|
||||||
<a
|
<a
|
||||||
role="button"
|
role="button"
|
||||||
class="navbar-burger burger"
|
class="navbar-burger burger"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/sms.html">SMS</a>
|
<a class="nav-link" href="/sms.html">SMS</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/sms.html">SMS</a>
|
<a class="nav-link" href="/sms.html">SMS</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/console">Console</a>
|
<a class="nav-link" href="/console">Console</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="row mt-5 mb-4">
|
<div class="row mt-5 mb-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|||||||
@@ -20,7 +20,13 @@ remount_rw() {
|
|||||||
remount_ro() {
|
remount_ro() {
|
||||||
mount -o remount,ro /
|
mount -o remount,ro /
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Installation Prep
|
||||||
remount_rw
|
remount_rw
|
||||||
|
systemctl daemon-reload
|
||||||
|
rm $SERVICE_FILE > /dev/null 2>&1
|
||||||
|
rm $SERVICE_NAME > /dev/null 2>&1
|
||||||
|
|
||||||
# Create the systemd service file
|
# Create the systemd service file
|
||||||
cat <<EOF > "$SERVICE_FILE"
|
cat <<EOF > "$SERVICE_FILE"
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -75,7 +81,7 @@ uninstall_simpleadmin() {
|
|||||||
rm -rf "$SIMPLE_ADMIN_DIR"
|
rm -rf "$SIMPLE_ADMIN_DIR"
|
||||||
rm -f /lib/systemd/system/ttyd.service
|
rm -f /lib/systemd/system/ttyd.service
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/ttyd.service
|
rm -f /lib/systemd/system/multi-user.target.wants/ttyd.service
|
||||||
rm -rf /bin/ttyd
|
rm -f /bin/ttyd
|
||||||
echo -e "\e[1;32mttyd has been uninstalled.\e[0m"
|
echo -e "\e[1;32mttyd has been uninstalled.\e[0m"
|
||||||
|
|
||||||
echo "Uninstallation process completed."
|
echo "Uninstallation process completed."
|
||||||
@@ -137,6 +143,7 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
|||||||
sleep 1
|
sleep 1
|
||||||
cd $SIMPLE_ADMIN_DIR/www
|
cd $SIMPLE_ADMIN_DIR/www
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/deviceinfo.html
|
||||||
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/favicon.ico
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/index.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/index.html
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/network.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/network.html
|
||||||
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/settings.html
|
wget https://raw.githubusercontent.com/$GITUSER/quectel-rgmii-toolkit/$GITTREE/simpleadmin/www/settings.html
|
||||||
|
|||||||
@@ -12,6 +12,21 @@ LOG_FILE="/tmp/install_sshd.log"
|
|||||||
# Tmp Script dependent constants
|
# Tmp Script dependent constants
|
||||||
TAILSCALE_DIR="/usrdata/tailscale/"
|
TAILSCALE_DIR="/usrdata/tailscale/"
|
||||||
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
|
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
|
||||||
|
# Function to remount file system as read-write
|
||||||
|
remount_rw() {
|
||||||
|
mount -o remount,rw /
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to remount file system as read-only
|
||||||
|
remount_ro() {
|
||||||
|
mount -o remount,ro /
|
||||||
|
}
|
||||||
|
|
||||||
|
# Installation Prep
|
||||||
|
remount_rw
|
||||||
|
systemctl daemon-reload
|
||||||
|
rm $SERVICE_FILE > /dev/null 2>&1
|
||||||
|
rm $SERVICE_NAME > /dev/null 2>&1
|
||||||
|
|
||||||
# Create the systemd service file
|
# Create the systemd service file
|
||||||
cat <<EOF > "$SERVICE_FILE"
|
cat <<EOF > "$SERVICE_FILE"
|
||||||
@@ -30,11 +45,22 @@ EOF
|
|||||||
cat <<EOF > "$TMP_SCRIPT"
|
cat <<EOF > "$TMP_SCRIPT"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
export HOME=/usrdata/root
|
||||||
GITUSER="iamromulan"
|
GITUSER="iamromulan"
|
||||||
GITTREE="development"
|
GITTREE="development"
|
||||||
TAILSCALE_DIR="/usrdata/tailscale/"
|
TAILSCALE_DIR="/usrdata/tailscale/"
|
||||||
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
|
TAILSCALE_SYSD_DIR="/usrdata/tailscale/systemd"
|
||||||
|
|
||||||
|
# Function to remount file system as read-write
|
||||||
|
remount_rw() {
|
||||||
|
mount -o remount,rw /
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to remount file system as read-only
|
||||||
|
remount_ro() {
|
||||||
|
mount -o remount,ro /
|
||||||
|
}
|
||||||
|
|
||||||
install_update_tailscale() {
|
install_update_tailscale() {
|
||||||
echo "Checking if Tailscale is already installed..."
|
echo "Checking if Tailscale is already installed..."
|
||||||
if [ -f "$TAILSCALE_DIR/tailscale" ]; then
|
if [ -f "$TAILSCALE_DIR/tailscale" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user