Starup Script for Linux for DSHub

Discussion and questions about hub software
Locked
Toast

Starup Script for Linux for DSHub

Post by Toast » 09 Feb 2008, 21:01

Code: Select all

#!/bin/bash
# Startup Script for DSHub
# open a term and write "which java" without quotes 
# the path should pop up like this /usr/bin/java
# then enter that path to your startup script below. 
# don't forget to enter path for DSHub also
/your/path/to/java -jar /your/path/to/DSHub.jar
Note:
  • Remember that DSHub requires Java(TM) SE Runtime Environment (build 1.6.x.x)
    to test what version of java you got type this command "java -version".
    • Code: Select all

      cd /etc/init.d
      chmod 755 <scriptname>
    make sure to make this script executable by everyone

    This is an untested script so far haven't had time to test it on my Linux box yet so if there are any errors in it please report it to me.
Possible problems with this script is that DSHub will give an error message that it can't display GUI if there was a option to start with a hidden or no GUI that would improve this script

Toast

Proposed Startup Sequence

Post by Toast » 10 Feb 2008, 14:51

Code: Select all

#! /bin/sh
# Startup Script for DSHub
# open a term and write "which java" without quotes
# the path should pop up like this /usr/bin/java
# then enter that path to your startup script below.
# don't forget to enter path for DSHub also

case "$1" in
  start)
        echo -n "Starting DSHub"
        #To run it as root:
        /your/path/to/java -jar /your/path/to/DSHub.jar -nogui
        #Or to run it as some other user:
        /bin/su - username -c /your/path/to/java -jar /your/path/to/DSHub.jar -nogui
        echo "."
        ;;
  stop)
        echo -n "Stopping DSHub"
        #To run it as root:
        /your/path/to/java -jar /your/path/to/DSHub.jar -quit
        #Or to run it as some other user:
        /bin/su - username -c /your/path/to/java -jar /your/path/to/DSHub.jar -quit
        echo "."
        ;;

  *)
        echo "Usage: /sbin/service DSHub {start|stop}"
        exit 1
esac

exit 0
This is just how i want it this needs -quit and -nogui parameter to work first

Locked