#!/bin/sh # # Copyright (C) 2014, Jaguar Land Rover # # This program is licensed under the terms and conditions of the # Mozilla Public License, version 2.0. The full text of the # Mozilla Public License is at https://www.mozilla.org/MPL/2.0/ # # # Init.d script to start and stop an RVI system installed # through an RPM. # ### BEGIN INIT INFO # Provides: rvi # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: RVI Framework ### END INIT INFO export PATH="/bin/:/usr/bin:/sbin:/usr/sbin" . /etc/init.d/functions set -e DAEMON_PATH="/opt/rvi_core" DAEMON_NAME="rvi" case "$1" in start) echo -n "Starting $DAEMON_NAME: " $DAEMON_PATH/rvi_ctl -c /etc/opt/rvi/rvi.config start RETVAL=$? if [ $RETVAL -eq 0 ] ; then echo "OK" else echo "FAIL" fi ;; stop) echo -n "Stopping $DAEMON_NAME: " $DAEMON_PATH/rvi_ctl stop RETVAL=$? if [ $RETVAL -eq 0 ] ; then echo "OK" else echo "FAIL" fi ;; restart) echo -n "Restarting $DAEMON_NAME: " $DAEMON_PATH/rvi_ctl restart RETVAL=$? if [ $RETVAL -eq 0 ] ; then echo "OK" else echo "FAIL" fi ;; status) status $DAEMON_NAME RETVAL=$? ;; *) echo "usage: $0 { start | stop | status | restart | status }" ;; esac exit $RETVAL