27 lines
516 B
Markdown
27 lines
516 B
Markdown
|
# Setup
|
||
|
|
||
|
Root android with magisk
|
||
|
|
||
|
Install busybox
|
||
|
|
||
|
Create init script at `/data/adb/service.d/mqtt2exec.sh`
|
||
|
|
||
|
```shell
|
||
|
#!/system/bin/sh
|
||
|
/system/xbin/start-stop-daemon -S -b /system/xbin/mqtt2exec -- tcp://ENDPOINT:1883 CLIENT_ID USERNAME PASSWORD
|
||
|
exit 0
|
||
|
```
|
||
|
|
||
|
Set it as executable: `chmod +x /data/adb/service.d/mqtt2exec.sh`
|
||
|
|
||
|
Install binary:
|
||
|
|
||
|
```shell
|
||
|
adb push mqtt2exec /storage/emulated/0/mqtt2exec
|
||
|
adb shell
|
||
|
su
|
||
|
mv /storage/emulated/0/mqtt2exec /system/xbin/mqtt2exec
|
||
|
chmod +x /system/xbin/mqtt2exec
|
||
|
```
|
||
|
|
||
|
Reboot :)
|