@@ -42,11 +42,11 @@ wait_for_adb_shell() {
42
42
43
43
setup_rootshell () {
44
44
_adb_push rootshell /tmp/
45
- " $SERIAL_PATH " " AT+SYSCMD= cp /tmp/rootshell /bin/rootshell"
45
+ _at_syscmd " cp /tmp/rootshell /bin/rootshell"
46
46
sleep 1
47
- " $SERIAL_PATH " " AT+SYSCMD= chown root /bin/rootshell"
47
+ _at_syscmd " chown root /bin/rootshell"
48
48
sleep 1
49
- " $SERIAL_PATH " " AT+SYSCMD= chmod 4755 /bin/rootshell"
49
+ _at_syscmd " chmod 4755 /bin/rootshell"
50
50
_adb_shell ' /bin/rootshell -c id'
51
51
echo " we have root!"
52
52
}
@@ -59,18 +59,22 @@ _adb_shell() {
59
59
" $ADB " shell " $1 "
60
60
}
61
61
62
+ _at_syscmd () {
63
+ " $SERIAL_PATH " " AT+SYSCMD=$1 "
64
+ }
65
+
62
66
setup_rayhunter () {
63
- _adb_shell ' /bin/rootshell -c "mkdir -p /data/rayhunter"'
67
+ _at_syscmd " mkdir -p /data/rayhunter"
64
68
_adb_push config.toml.example /data/rayhunter/config.toml
65
69
_adb_push rayhunter-daemon /data/rayhunter/
66
70
_adb_push scripts/rayhunter_daemon /tmp/rayhunter_daemon
67
71
_adb_push scripts/misc-daemon /tmp/misc-daemon
68
- _adb_shell ' /bin/rootshell -c "cp /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"'
69
- _adb_shell ' /bin/rootshell -c "cp /tmp/misc-daemon /etc/init.d/misc-daemon"'
70
- _adb_shell ' /bin/rootshell -c "chmod 755 /etc/init.d/rayhunter_daemon"'
71
- _adb_shell ' /bin/rootshell -c "chmod 755 /etc/init.d/misc-daemon"'
72
+ _at_syscmd " cp /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"
73
+ _at_syscmd " cp /tmp/misc-daemon /etc/init.d/misc-daemon"
74
+ _at_syscmd " chmod 755 /etc/init.d/rayhunter_daemon"
75
+ _at_syscmd " chmod 755 /etc/init.d/misc-daemon"
72
76
echo -n " waiting for reboot..."
73
- _adb_shell ' /bin/rootshell -c reboot'
77
+ _at_syscmd reboot
74
78
75
79
# first wait for shutdown (it can take ~10s)
76
80
until ! _adb_shell true 2> /dev/null
0 commit comments