Refine clean up procedure
This commit is contained in:
@@ -31,7 +31,7 @@ class SettingsFragment : PreferenceFragmentCompatDividers(), ServiceConnection {
|
||||
"while iptables -D FORWARD -j vpnhotspot_fwd; do done",
|
||||
"iptables -F vpnhotspot_fwd",
|
||||
"iptables -X vpnhotspot_fwd",
|
||||
"ip rule del lookup 62",
|
||||
"while ip rule del lookup 62; do done",
|
||||
"ip route flush table 62")
|
||||
true
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ const val NOISYSU_TAG = "NoisySU"
|
||||
const val NOISYSU_SUFFIX = "SUCCESS\n"
|
||||
fun noisySu(vararg commands: String): Boolean {
|
||||
val process = ProcessBuilder("su", "-c", """function noisy() { "$@" || echo "$@" exited with $?; }
|
||||
${commands.joinToString("\n") { "noisy $it" }}
|
||||
${commands.joinToString("\n") { if (it.startsWith("while ")) it else "noisy $it" }}
|
||||
echo $NOISYSU_SUFFIX""")
|
||||
.redirectErrorStream(true)
|
||||
.start()
|
||||
|
||||
Reference in New Issue
Block a user