Fix typos and missing remount_rw

This commit is contained in:
iamromulan
2024-02-22 16:14:21 -05:00
committed by GitHub
parent b210afdb47
commit bc5bd18e72

View File

@@ -165,6 +165,7 @@ install_update_at_socat() {
sleep 2s
systemctl start socat-smd7-to-ttyIN
systemctl start socat-smd7-from-ttyIN
remount_ro
cd /
;;
1)
@@ -177,6 +178,7 @@ install_update_at_socat() {
sleep 2s
systemctl start socat-smd11-to-ttyIN
systemctl start socat-smd11-from-ttyIN
remount_ro
cd /
;;
esac
@@ -186,24 +188,24 @@ install_update_at_socat() {
# Function to install Simple Firewall
install_simple_firewall() {
systemctl stop simplefirewall
systemctl stop ttl-overide
systemctl stop ttl-override
echo -e "\033[0;32mInstalling/Updating Simple Firewall...\033[0m"
mount -o remount,rw /
mkdir -p "$SIMPLE_FIREWALL_DIR"
mkdir -p "$SIMPLE_FIREWALL_SYSTEMD_DIR"
wget -O "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/simplefirewall.sh
wget -O "$SIMPLE_FIREWALL_DIR/ttl-overide" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/ttl-overide
wget -O "$SIMPLE_FIREWALL_DIR/ttl-override" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/ttl-override
wget -O "$SIMPLE_FIREWALL_DIR/ttlvalue" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/ttlvalue
chmod +x "$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
chmod +x "$SIMPLE_FIREWALL_DIR/ttl-overide"
chmod +x "$SIMPLE_FIREWALL_DIR/ttl-override"
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/systemd/simplefirewall.service
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-overide.service" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/systemd/ttl-overide.service
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" https://raw.githubusercontent.com/iamromulan/quectel-rgmii-toolkit/$GITTREE/simplefirewall/systemd/ttl-override.service
cp -f $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/ttl-overide.service" "/lib/systemd/system/multi-user.target.wants/"
ln -sf "/lib/systemd/system/ttl-override.service" "/lib/systemd/system/multi-user.target.wants/"
systemctl daemon-reload
systemctl start simplefirewall
systemctl start ttl-overide
systemctl start ttl-override
remount_ro
echo -e "\033[0;32mSimple Firewall installation/update complete.\033[0m"
}
@@ -392,6 +394,7 @@ install_simple_admin() {
uninstall_simpleadmin_components() {
echo "Starting the uninstallation process for Simpleadmin components."
echo "Note: Uninstalling certain components may affect the functionality of others."
remount_rw
# Uninstall Simple Firewall
echo "Do you want to uninstall Simplefirewall?"
@@ -402,9 +405,9 @@ uninstall_simpleadmin_components() {
if [ "$choice_simplefirewall" -eq 1 ]; then
echo "Uninstalling Simplefirewall..."
systemctl stop simplefirewall
systemctl stop ttl-overide
systemctl stop ttl-override
rm -f /lib/systemd/system/simplefirewall.service
rm -f /lib/systemd/system/ttl-overide.service
rm -f /lib/systemd/system/ttl-override.service
systemctl daemon-reload
rm -rf "$SIMPLE_FIREWALL_DIR"
echo "Simplefirewall uninstalled."
@@ -418,6 +421,7 @@ uninstall_simpleadmin_components() {
read -p "Enter your choice (1 or 2): " choice_socat_at_bridge
if [ "$choice_socat_at_bridge" -eq 1 ]; then
echo "Uninstalling socat-at-bridge..."
systemctl stop at-telnet-daemon
systemctl stop socat-smd11
systemctl stop socat-smd11-to-ttyIN
systemctl stop socat-smd11-from-ttyIN
@@ -430,8 +434,11 @@ uninstall_simpleadmin_components() {
rm -f /lib/systemd/system/socat-smd7.service
rm -f /lib/systemd/system/socat-smd7-to-ttyIN.service
rm -f /lib/systemd/system/socat-smd7-from-ttyIN.service
rm -f /lib/systemd/system/at-telnet-daemon.service
systemctl daemon-reload
rm -rf "$SOCAT_AT_DIR"
rm -rf "/usrdata/micropython"
rm -rf "/usrdata/at-telnet"
echo "socat-at-bridge uninstalled."
fi
@@ -449,6 +456,7 @@ uninstall_simpleadmin_components() {
systemctl daemon-reload
rm -rf "$SIMPLE_ADMIN_DIR"
echo "The rest of Simpleadmin uninstalled."
remount_ro
fi
echo "Uninstallation process completed."
@@ -491,7 +499,6 @@ install_update_remove_tailscale() {
$TAILSCALE_DIR/tailscale down
$TAILSCALE_DIR/tailscale logout
systemctl stop tailscaled
systemctl disable tailscaled
rm -f /lib/systemd/system/tailscaled.service
systemctl daemon-reload
rm -rf $TAILSCALE_DIR