#!/bin/sh ### BEGIN INIT INFO # Provides: robertalab # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start, stop or restart the robertalab # Description: No ### END INIT INFO # Author: Beate case "$1" in start) cd /home/pi/OpenRoberta nohup ./admin.sh start-embedded-server -d server.port=80 -d robot.crosscompiler.resourcebase=ora-cc-rsc -d database.parentdir=. -d robot.whitelist=sim,wedo,ev3lejosv1,ev3lejosv0,ev3dev,nxt,microbit,botnroll,nao,bob3,sensebox,mbot,uno,nano,mega,calliope2017,calliope2016& ;; stop) cd /home/pi/OpenRoberta echo stop robertalab server=$(ps aux |grep '[j]ava.*-d server.port=80' |awk '{print $2}') echo kill $server sudo kill $server ;; restart) echo restart robertalab $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" ;; esac