Edit Install/Uninstall scripts; Update README.md

Edited Install and Uninstall scripts to handle both at_telnet_daemon and simpleadmin
This commit is contained in:
iamromulan
2023-09-20 00:35:38 -04:00
parent a7b156ab4e
commit 7f80364ac0
39 changed files with 132 additions and 7 deletions

View File

@@ -1,7 +1,35 @@
# AT Telnet Daemon and Simple Admin combo installer/uninstaller # AT Telnet Daemon and Simple Admin combo installer/uninstaller
This will install a Combination of https://github.com/natecarlson/quectel-rgmii-at-command-client/tree/main/at_telnet_daemon and; https://github.com/rbflurry/quectel-rgmii-simpleadmin This will install a Combination of https://github.com/natecarlson/quectel-rgmii-at-command-client/tree/main/at_telnet_daemon and; https://github.com/rbflurry/quectel-rgmii-simpleadmin
ONLY FOR THE QUECTEL RM520N-GL ONLY FOR THE QUECTEL RM520N-GL
*****WORK IN PROGRESS NOT READY TO INSTALL***** *****WORK IN PROGRESS NOT READY TO INSTALL*****
## Installation Automated
Script will do everything but setup Nate's at_telnet_daemon
```bash
adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/install_on_modem.sh
adb shell chmod +x /tmp/install_on_modem.sh
adb shell sh /tmp/install_on_modem.sh
```
## Uninstallation Automated
Script will ask to remove Simpleadmin then ask to remove AT Telnet Daemon
```bash
adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/uninstall_on_modem.sh
adb shell chmod +x /tmp/install_on_modem.sh
adb shell sh /tmp/install_on_modem.sh
```
# 2 Original README.md files
# AT Telnet Daemon for Quectel Modem # AT Telnet Daemon for Quectel Modem
This will provide a telnet interface to the AT command port of Quectel modems that are connected via a RGMII Ethernet interface (aka a "RJ45 to M.2" or "Ethernet to M.2" adapter board). It is an alternative to the ETH AT command interface that Quectel provides, which is a bit flaky and requires a custom client. This will provide a telnet interface to the AT command port of Quectel modems that are connected via a RGMII Ethernet interface (aka a "RJ45 to M.2" or "Ethernet to M.2" adapter board). It is an alternative to the ETH AT command interface that Quectel provides, which is a bit flaky and requires a custom client.
@@ -118,7 +146,7 @@ If you are able to test on other modems and get it working, feel free to PR.
## Installation Automated ## Installation Automated
Script will do everything but setup Nate's at_telnet_daemon Script will do everything but setup Nate's at_telnet_daemon
```bash ```bash
adb shell wget -P /tmp https://raw.githubusercontent.com/rbflurry/quectel-rgmii-simpleadmin/main/install_on_modem.sh adb shell wget -P /tmp https://raw.githubusercontent.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/main/install_on_modem.sh
adb shell chmod +x /tmp/install_on_modem.sh adb shell chmod +x /tmp/install_on_modem.sh
adb shell sh /tmp/install_on_modem.sh adb shell sh /tmp/install_on_modem.sh
``` ```

View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
# #
# Installs SimpleAdmin # Installs AT Telnet Daemon and Simple Admin
# #
read -p "Do you want to install SimpleAdmin (yes/no) " yn read -p "Do you want to download AT Telnet Daemon and Simple Admin (yes/no) " yn
case $yn in case $yn in
yes ) echo ok, we will proceed;; yes ) echo ok, we will proceed;;
@@ -17,14 +17,68 @@ esac
# Download # Download
cd /tmp cd /tmp
wget https://github.com/rbflurry/quectel-rgmii-simpleadmin/archive/refs/heads/main.zip wget https://github.com/iamromulan/quectel-rgmii-simpleadmin-at-telnet-daemon/archive/refs/heads/main.zip
# Unzip # Unzip
unzip main.zip unzip main.zip
cp -R quectel-rgmii-simpleadmin-main* simpleadmin/ cp -R quectel-rgmii-simpleadmin-at-telnet-daemon-main* simpleadminattelnetdaemon/
read -p "Do you want to Install AT Telnet Daemon (yes/no) " yn
case $yn in
yes ) echo ok, we will proceed;;
no ) echo exiting...;
exit;;
* ) echo invalid response;
exit 1;;
esac
# Copy over to /usrdata # Copy over to /usrdata
cp -R /tmp/simpleadmin /usrdata/ cp -R /tmp/simpleadminattelnetdaemon/attelnetdaemon/at-telnet /usrdata/
cp -R /tmp/simpleadminattelnetdaemon/attelnetdaemon/micropython /usrdata/
# Chmod execute
chmod +x /usrdata/micropython/micropython /usrdata/at-telnet/modem-multiclient.py /usrdata/at-telnet/socat-armel-static /usrdata/at-telnet/picocom
# Remount
mount -o remount,rw /
# Copy systemd init files & reload
cp /usrdata/at-telnet/systemd_units/*.service /lib/systemd/system
systemctl daemon-reload
# Link systemd files
ln -s /lib/systemd/system/at-telnet-daemon.service /lib/systemd/system/multi-user.target.wants/
ln -s /lib/systemd/system/socat-smd11.service /lib/systemd/system/multi-user.target.wants/
ln -s /lib/systemd/system/socat-smd11-to-ttyIN.service /lib/systemd/system/multi-user.target.wants/
ln -s /lib/systemd/system/socat-smd11-from-ttyIN.service /lib/systemd/system/multi-user.target.wants/
# Remount readonly
mount -o remount,ro /
# Start Services
systemctl start socat-smd11
sleep 2s
systemctl start socat-smd11-to-ttyIN
systemctl start socat-smd11-from-ttyIN
systemctl start at-telnet-daemon
read -p "Do you want to install Simple Admin (yes/no) " yn
case $yn in
yes ) echo ok, we will proceed;;
no ) echo exiting...;
exit;;
* ) echo invalid response;
exit 1;;
esac
# Copy over to /usrdata
cp -R /tmp/simpleadminattelnetdaemon/simpleadmin /usrdata/
# Chmod execute on scripts and cgi-bin # Chmod execute on scripts and cgi-bin
chmod +x /usrdata/simpleadmin/scripts/* /usrdata/simpleadmin/www/cgi-bin/* /usrdata/simpleadmin/ttl/ttl-override chmod +x /usrdata/simpleadmin/scripts/* /usrdata/simpleadmin/www/cgi-bin/* /usrdata/simpleadmin/ttl/ttl-override

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Removes SimpleAdmin # Removes SimpleAdmin and AT Telnet Daemon
# #
read -p "Do you want to uninstall SimpleAdmin (yes/no) " yn read -p "Do you want to uninstall SimpleAdmin (yes/no) " yn
@@ -47,3 +47,46 @@ systemctl daemon-reload
# Remount readonly # Remount readonly
mount -o remount,ro / mount -o remount,ro /
read -p "Do you want to uninstall AT Telnet Daemon (yes/no) " yn
case $yn in
yes ) echo ok, we will proceed;;
no ) echo exiting...;
exit;;
* ) echo invalid response;
exit 1;;
esac
# ExecStop
systemctl at-telnet-daemon socat-smd11 socat-smd11-to-ttyIN socat-smd11-from-ttyIN
#Remove from /usrdata
rm -rf /usrdata/at-telnet
rm -rf /usrdata/micropython
# Remount
mount -o remount,rw /
# Copy systemd init files & reload
#remove links
rm /lib/systemd/system/multi-user.target.wants/at-telnet-daemon.service
rm /lib/systemd/system/multi-user.target.wants/socat-smd11.service
rm /lib/systemd/system/timers.target.wants/socat-smd11-to-ttyIN.service
rm /lib/systemd/system/multi-user.target.wants/socat-smd11-from-ttyIN.service
#remove files
rm /lib/systemd/system/at-telnet-daemon.service
rm /lib/systemd/system/socat-smd11.service
rm /lib/systemd/system/socat-smd11-to-ttyIN.service
rm /lib/systemd/system/socat-smd11-from-ttyIN.service
systemctl daemon-reload
# Link systemd files
# Remount readonly
mount -o remount,ro /