MiSTer_WebMenu icon indicating copy to clipboard operation
MiSTer_WebMenu copied to clipboard

Autostart Webmenu on each MiSTer start

Open yavimaya opened this issue 4 years ago • 2 comments

The initial script should offer the possibility to autostart each time you turn on MiSTer.

Maybe you can use /etc/init.d/ dir.

yavimaya avatar May 12 '20 15:05 yavimaya

This one should be easy, not a priority right now, though. I'll plan to add it after game support.

nilp0inter avatar May 12 '20 17:05 nilp0inter

Here's what I did:

create the file /etc/init.d/S99webmenu with the following contents:

#!/bin/sh

[ -f /media/fat/Scripts/webmenu.sh ] || exit 0

start() {
        printf "Starting WebMenu service: "
        /media/fat/Scripts/webmenu.sh
        [ $? = 0 ] && echo "OK" || echo "FAIL"
}

stop() {
        printf "Shutting down WebMenu service: "
        kill -9 `pidof WebMenu`
        [ $? = 0 ] && echo "OK" || echo "FAIL"
}

restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

Gdsimms avatar Sep 25 '20 15:09 Gdsimms