summaryrefslogtreecommitdiffstats
path: root/networking/modem/device-files/disable_modem.sh
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-06-19 02:21:28 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-06-26 01:54:34 +0200
commit7a870899dbce365e780331598cfe24f47db12590 (patch)
tree9d9415de3e28b36ac08026105a7977b5ecd34870 /networking/modem/device-files/disable_modem.sh
parent384039334283f31a50b0e4034e88018538a8cbca (diff)
downloadvendor_replicant-scripts-7a870899dbce365e780331598cfe24f47db12590.tar.gz
vendor_replicant-scripts-7a870899dbce365e780331598cfe24f47db12590.tar.bz2
vendor_replicant-scripts-7a870899dbce365e780331598cfe24f47db12590.zip
modem: rework script user interface
The current interface has various issues that are fixed by this new interface. Here's the design decisions that went into the new interface: - On various computer formfactors, like desktops, laptops and servers, people running commands in them typically use a complete hardware keyboard to type them. Tab is typically available for command completion which makes commands like disable_modem.sh way less common than modem_disable.sh. The result is that modem_disable feels more intuitive to people that are already used to type commands. - On Replicant 6.0, on the Galaxy SII which has a small screen, the underscore (_) key is not immediately available on the default keyboard, and to get it, you need to press the "?123" key and press longer on the minus key (-) to finally have 3 choices where the underscore displayed in the middle and selected by default. However the spacebar ( ) is available. - On Replicant 6.0, on the Galaxy SII, with the default keyboard, the Tab key is also not available at all, so it's best if the commands are as short as possible to type, as any mistake requires the user to restart typing it from scratch as there are no arrow keys that could enable them to correct the previous command (assuming they know that arrows can do that, which is typically not the case for many people new to the command line). 'on' and 'off' are way shorter and less error prone than 'enable' and 'disable'. - Using modem.sh is longer than modem, however the dot (.) is available on the default keyboard, including on the Galaxy SII, and to many people that know a bit about the shell, it will not hide the fact that it is a shell script, which can empower them to modify it. - For the usage message the text has been made in a way that can fit the Galaxy SII small screen. It also been made to enable users to just type again 'modem.sh off' without necessarily understanding the shell semantics like # or $. - Finally the commands need to be easy enough to remember or to find as people might be in a hurry and need to enable or disable the modem fast, while being far away from any computer or Internet connection. While 'modem.sh enable' is probably easier to remember, 'modem.sh on' is good enough, while being shorted to type. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'networking/modem/device-files/disable_modem.sh')
-rwxr-xr-xnetworking/modem/device-files/disable_modem.sh44
1 files changed, 0 insertions, 44 deletions
diff --git a/networking/modem/device-files/disable_modem.sh b/networking/modem/device-files/disable_modem.sh
deleted file mode 100755
index 5650656..0000000
--- a/networking/modem/device-files/disable_modem.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/system/xbin/bash
-#
-# Copyright (C) 2017 Jeremy Rand <jeremy@veclabs.net>
-# Partially based on code by Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> and Filippo Fil Bergamo
-#
-# This file is part of "SlightlyBetterAirplaneMode", a set of shell scripts to shut off
-# the Samsung phone modem without trusting the non-free modem firmware.
-#
-# SlightlyBetterAirplaneMode is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SlightlyBetterAirplaneMode is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-set -euf -o pipefail
-
-echo "Remounting system partition as writable..."
-mount -o rw,remount /system
-
-echo "Disabling RIL..."
-mv /system/lib/libsamsung-ril.so /system/lib/libsamsung-ril.so.disabled || echo 'RIL was already disabled.'
-
-echo "Syncing filesystem..."
-sync
-sync
-
-echo "Remounting system partition as read-only..."
-mount -o ro,remount /system
-
-echo "Syncing filesystem..."
-sync
-sync
-
-am force-stop org.smssecure.smssecure
-# https://android.stackexchange.com/a/139139
-echo "Modem will be disabled after we reboot now..."
-am start -a android.intent.action.REBOOT