Skip to content

Commit

Permalink
workaround for root not being root permissions issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperq committed Oct 23, 2024
1 parent 4e86284 commit 124a594
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions dist/install-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,22 @@ _adb_shell() {
"$ADB" shell "$1"
}

_at_syscmd() {
"$SERIAL_PATH" "AT+SYSCMD=$1"
}

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 rayhunter-daemon /data/rayhunter/
_adb_push scripts/rayhunter_daemon /tmp/rayhunter_daemon
_adb_push scripts/misc-daemon /tmp/misc-daemon
_adb_shell '/bin/rootshell -c "cp /tmp/rayhunter_daemon /etc/init.d/rayhunter_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"'
_adb_shell '/bin/rootshell -c "chmod 755 /etc/init.d/misc-daemon"'
_at_syscmd "cp /tmp/rayhunter_daemon /etc/init.d/rayhunter_daemon"
_at_syscmd "cp /tmp/misc-daemon /etc/init.d/misc-daemon"
_at_syscmd "chmod 755 /etc/init.d/rayhunter_daemon"
_at_syscmd "chmod 755 /etc/init.d/misc-daemon"
echo -n "waiting for reboot..."
_adb_shell '/bin/rootshell -c reboot'
_at_syscmd reboot

# first wait for shutdown (it can take ~10s)
until ! _adb_shell true 2> /dev/null
Expand Down

0 comments on commit 124a594

Please sign in to comment.