3
# agent-smith Startup script for cloud servers guest agent
6
# description: agent-smith is a agent meant to run on linux guest instances \
7
# on Citrix XenServer for manipulating the guest through \
9
# processname: agent-smith
10
# pidfile: /var/run/agent-smith.pid
12
# Source function library.
13
. /etc/rc.d/init.d/functions
16
exec_prefix=@exec_prefix@
17
datarootdir=@datarootdir@
21
scriptdir=${datadir}/agent-smith
23
updatename="/var/run/agent-smith.tar"
24
pidfile="/var/run/agent-smith.pid"
27
if [ -e $updatename -o -e ${updatename}.gz ]; then
28
if [ -e ${updatename}.gz ] ; then
29
updatename="${updatename}.gz"
35
if tar -t${tarargs}f $updatename > /dev/null 2>&1 ; then
36
cat ${scriptdir}/filelist | while read f ; do
37
test -f "$f" && rm -f "$f"
39
tar -x${tarargs}C / -f $updatename
41
echo "Ignoring broken update archive"
43
rm -f $updatename ${updatename}.gz
49
${asbindir}/agent-smith ${scriptdir}/dispatcher.sh
69
echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2