updated startup scripts

GPrathap 9 years ago
parent ddc6f8d0e2
commit cbac367254

@ -26,6 +26,9 @@ during boot up process.
create a service: create a service:
` sudo ./startService.sh ` ` sudo ./startService.sh `
get current state of the service:
` sudo service RaspberryService.sh status `
start service: start service:
` sudo service RaspberryService.sh start ` ` sudo service RaspberryService.sh start `
@ -35,8 +38,7 @@ stop service:
restart service: restart service:
` sudo service RaspberryService.sh restart ` ` sudo service RaspberryService.sh restart `
get current state of the service:
` sudo service RaspberryService.sh status `

@ -46,7 +46,6 @@ PIDFILE=/var/run/$DAEMON_NAME.pid
DAEMON_OPTS="-l /usr/local/src/RaspberryAgent/RaspberryStats.log -m N -i 60" DAEMON_OPTS="-l /usr/local/src/RaspberryAgent/RaspberryStats.log -m N -i 60"
# This next line determines what user the script runs as. # This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=root #pi DAEMON_USER=root #pi
# Load the VERBOSE setting and other rcS variables # Load the VERBOSE setting and other rcS variables

@ -54,8 +54,8 @@ LOG_LEVEL = logging.INFO # Could be e.g. "DEBUG" or "WARNING"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python version # Python version
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if sys.version_info<(2,7,5): if sys.version_info<(2,7,0):
sys.stderr.write("You need python 2.7.5 or later to run this script\n") sys.stderr.write("You need python 2.7.0 or later to run this script\n")
exit(1) exit(1)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@ -31,6 +31,7 @@ import running_mode
global HOST_NAME global HOST_NAME
HOST_NAME = "0.0.0.0" HOST_NAME = "0.0.0.0"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HTTP_SERVER_PORT = 5678 # http server port which is listning on
global LAST_TEMP global LAST_TEMP
LAST_TEMP = 25 # The Last read temperature value from the DHT sensor. Kept globally LAST_TEMP = 25 # The Last read temperature value from the DHT sensor. Kept globally
@ -40,9 +41,7 @@ TEMPERATURE_READING_INTERVAL_REAL_MODE = 3
TEMPERATURE_READING_INTERVAL_VIRTUAL_MODE = 60 TEMPERATURE_READING_INTERVAL_VIRTUAL_MODE = 60
TEMP_PIN = 4 TEMP_PIN = 4
TEMP_SENSOR_TYPE = 11 TEMP_SENSOR_TYPE = 11
BULB_PIN = 11 # The GPIO Pin# in RPi to which the LED is connected BULB_PIN = 11 # The GPIO Pin# in RPi to which the LED is connected
HTTP_SERVER_PORT = 5678 # http server port which is listning on
global GPIO global GPIO
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@ -20,6 +20,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo "----------------------------------------------------------------"
echo "| WSO2 IOT Sample "
echo "| RaspiAgent "
echo "| ---------------- "
echo "| ....initializing service-start-script "
echo "----------------------------------------------------------------"
destination="/usr/local/src/RaspberryAgent" destination="/usr/local/src/RaspberryAgent"
currentDir=$PWD currentDir=$PWD
if [ ! -d "$destination" ] if [ ! -d "$destination" ]

Loading…
Cancel
Save