mirror of
https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git
synced 2025-09-02 20:52:41 +02:00
Moved some configutation options to the config files Minor text changes Converted a lot of spaces to tabs
47 lines
779 B
Bash
Executable File
47 lines
779 B
Bash
Executable File
#!/bin/sh
|
|
|
|
PIDFILE="/run/debugOnOsd.pid"
|
|
|
|
status()
|
|
{
|
|
pid="$(cat "$PIDFILE" 2>/dev/null)"
|
|
if [ "$pid" ]; then
|
|
kill -0 "$pid" >/dev/null && echo "PID: $pid" || return 1
|
|
fi
|
|
}
|
|
|
|
start()
|
|
{
|
|
if [ -f ${PIDFILE} ]; then
|
|
echo "Debug on OSD already running";
|
|
else
|
|
echo "Starting debug on OSD"
|
|
/system/sdcard/scripts/debugInOsd.sh &>/dev/null &
|
|
# /system/sdcard/bin/busybox nohup /system/sdcard/scripts/debugInOsd.sh &>/dev/null
|
|
echo "$!" > "$PIDFILE"
|
|
fi
|
|
}
|
|
|
|
stop()
|
|
{
|
|
pid="$(cat "$PIDFILE" 2>/dev/null)"
|
|
if [ "${pid}" ]; then
|
|
kill "$pid" && rm "$PIDFILE"
|
|
if [ -f /system/sdcard/controlscripts/configureOsd ]; then
|
|
source /system/sdcard/controlscripts/configureOsd
|
|
fi
|
|
|
|
fi
|
|
}
|
|
|
|
if [ $# -eq 0 ]; then
|
|
start
|
|
else
|
|
case $1 in start|stop|status)
|
|
$1
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
|