mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-30 11:19:26 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7addf3a67f | ||
|
|
4d8cc9b738 | ||
|
|
b0d797d206 | ||
|
|
1ae3b5020b | ||
|
|
a23df84848 |
30
dist/install-common.sh
vendored
30
dist/install-common.sh
vendored
@@ -42,11 +42,11 @@ wait_for_adb_shell() {
|
|||||||
|
|
||||||
setup_rootshell() {
|
setup_rootshell() {
|
||||||
_adb_push rootshell /tmp/
|
_adb_push rootshell /tmp/
|
||||||
"$SERIAL_PATH" "AT+SYSCMD=cp /tmp/rootshell /bin/rootshell"
|
_at_syscmd "cp /tmp/rootshell /bin/rootshell"
|
||||||
sleep 1
|
sleep 1
|
||||||
"$SERIAL_PATH" "AT+SYSCMD=chown root /bin/rootshell"
|
_at_syscmd "chown root /bin/rootshell"
|
||||||
sleep 1
|
sleep 1
|
||||||
"$SERIAL_PATH" "AT+SYSCMD=chmod 4755 /bin/rootshell"
|
_at_syscmd "chmod 4755 /bin/rootshell"
|
||||||
_adb_shell '/bin/rootshell -c id'
|
_adb_shell '/bin/rootshell -c id'
|
||||||
echo "we have root!"
|
echo "we have root!"
|
||||||
}
|
}
|
||||||
@@ -59,18 +59,26 @@ _adb_shell() {
|
|||||||
"$ADB" shell "$1"
|
"$ADB" shell "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_at_syscmd() {
|
||||||
|
"$SERIAL_PATH" "AT+SYSCMD=$1"
|
||||||
|
}
|
||||||
|
|
||||||
setup_rayhunter() {
|
setup_rayhunter() {
|
||||||
_adb_shell '/bin/rootshell -c "mkdir -p /data/rayhunter"'
|
_at_syscmd "mkdir -p /data/rayhunter"
|
||||||
_adb_push config.toml.example /data/rayhunter/config.toml
|
_adb_push config.toml.example /tmp/config.toml
|
||||||
_adb_push rayhunter-daemon /data/rayhunter/
|
_at_syscmd "mv /tmp/config.toml /data/rayhunter"
|
||||||
|
_adb_push rayhunter-daemon /tmp/rayhunter-daemon
|
||||||
|
_at_syscmd "mv /tmp/rayhunter-daemon /data/rayhunter"
|
||||||
_adb_push scripts/rayhunter_daemon /tmp/rayhunter_daemon
|
_adb_push scripts/rayhunter_daemon /tmp/rayhunter_daemon
|
||||||
|
_at_syscmd "mv /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"
|
||||||
_adb_push scripts/misc-daemon /tmp/misc-daemon
|
_adb_push scripts/misc-daemon /tmp/misc-daemon
|
||||||
_adb_shell '/bin/rootshell -c "cp /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"'
|
_at_syscmd "mv /tmp/misc-daemon /etc/init.d/misc-daemon"
|
||||||
_adb_shell '/bin/rootshell -c "cp /tmp/misc-daemon /etc/init.d/misc-daemon"'
|
|
||||||
_adb_shell '/bin/rootshell -c "chmod 755 /etc/init.d/rayhunter_daemon"'
|
_at_syscmd "chmod 755 /etc/init.d/rayhunter_daemon"
|
||||||
_adb_shell '/bin/rootshell -c "chmod 755 /etc/init.d/misc-daemon"'
|
_at_syscmd "chmod 755 /etc/init.d/misc-daemon"
|
||||||
|
|
||||||
echo -n "waiting for reboot..."
|
echo -n "waiting for reboot..."
|
||||||
_adb_shell '/bin/rootshell -c reboot'
|
_at_syscmd "shutdown -r -t 1 now"
|
||||||
|
|
||||||
# first wait for shutdown (it can take ~10s)
|
# first wait for shutdown (it can take ~10s)
|
||||||
until ! _adb_shell true 2> /dev/null
|
until ! _adb_shell true 2> /dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user