#! /bin/sh
### BEGIN INIT INFO
# Provides:          3dprinteros
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: 3DPrinterOS Client
# Description: a client for 3DPrinterOS - cloud 3D printing software
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/lsb/init-functions

case "$1" in
  start)
        cd /home/printeros/3dprinteros-client/
        python3 launcher.py
        ;;
  stop)
        kill -9 `cat /tmp/3dprinteros.pid`
        ;;

  restart|reload|force-reload)
        kill -9 `cat /tmp/3dprinteros.pid`
        cd /home/printeros/3dprinteros-client/
        python3 launcher.py
        ;;
  *)
        # echo "Usage: $0 start|stop" >&2
        # exit 3
        ;;
esac
