-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joschi99
committed
Oct 26, 2016
1 parent
66aa682
commit bb16e73
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/sh | ||
# FusionInventory-Agent - this script starts and stops the FusionInventory Agent | ||
# Created by Jochen Platzgummer (c)2014 | ||
# | ||
# chkconfig: - 85 15 | ||
# description: FusionInventory Agent | ||
# processname: fusioninventory-agent | ||
# config: /usr/local/fusioninventory-agent/etc/fusioninventory/agent.cfg | ||
# pidfile: /usr/local/fusioninventory-agent/var/fusioninventory/fusioninventory.pid | ||
|
||
# Source function library. | ||
. /etc/rc.d/init.d/functions | ||
|
||
OPTIONS="--conf-file /usr/local/fusioninventory-agent/etc/fusioninventory/agent.cfg -d" | ||
RETVAL=0 | ||
prog="FusionInventory-Agent" | ||
DAEMON=/usr/local/fusioninventory-agent/bin/fusioninventory-agent | ||
|
||
lockfile=/var/lock/subsys/fusioninventory-agent | ||
pidfile=/usr/local/fusioninventory-agent/var/fusioninventory/fusioninventory.pid | ||
|
||
start() { | ||
echo -n $"Starting $prog: " | ||
daemon ${DAEMON} $OPTIONS | ||
RETVAL=$? | ||
echo | ||
touch $lockfile | ||
return $RETVAL | ||
} | ||
|
||
|
||
stop() { | ||
echo -n $"Stopping $prog: " | ||
killproc ${DAEMON} 2>/dev/null | ||
RETVAL=$? | ||
echo | ||
# rm -f $lockfile | ||
# if test -f /usr/local/fusioninventory-agent/var/fusioninventory/fusioninventory-agent.pid ; then | ||
# [ $RETVAL -eq 0 ] && rm -f /usr/local/fusioninventory-agent/var/fusioninventory/fusioninventory-agent.pid | ||
# fi | ||
if [ $RETVAL -eq 0 ] ; then | ||
rm -f $lockfile $pidfile | ||
fi | ||
return $RETVAL | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
rh_status() { | ||
status $prog | ||
} | ||
|
||
rh_status_q() { | ||
rh_status >/dev/null 2>&1 | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
restart | ||
;; | ||
status) | ||
status fusioninventory-agent | ||
RETVAL=$? | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|status|restart}" | ||
RETVAL=1 | ||
esac | ||
|
||
exit $RETVAL |