View | Details | Raw Unified | Return to bug 197827
Collapse All | Expand All

(-)files/xymon-client.in (-4 / +40 lines)
Lines 16-25 Link Here
16
: ${xymon_client_enable:=NO}
16
: ${xymon_client_enable:=NO}
17
: ${xymon_client_user:=%%XYMONUSER%%}
17
: ${xymon_client_user:=%%XYMONUSER%%}
18
18
19
command=%%WWWDIR%%/client/runclient.sh
20
command_args="${xymon_client_flags} ${1}"
21
procname=%%WWWDIR%%/client/bin/xymonlaunch
22
pidfile="%%WWWDIR%%/client/logs/clientlaunch.`hostname`.pid"
19
pidfile="%%WWWDIR%%/client/logs/clientlaunch.`hostname`.pid"
23
start_precmd="chown -R ${xymon_client_user} %%WWWDIR%%/client/logs"
20
command=%%WWWDIR%%/client/bin/xymonlaunch
21
command_args="--config=%%WWWDIR%%/client/etc/clientlaunch.cfg --log=%%WWWDIR%%/client/logs/clientlaunch.log --pidfile=${pidfile}"
22
start_precmd=xymon_precmd
24
23
24
xymon_precmd()
25
{
26
	# Don't actually pass $xymon_client_flags to $command
27
	rc_flags=""
28
29
	# Ensure permissions of log dir
30
	chown -R ${xymon_client_user} %%WWWDIR%%/client/logs
31
32
	# Below is pulled almost directly from Xymon's runclient.sh script which we are bypassing due to redundancy
33
34
	# Default settings for this client
35
	MACHINEDOTS="`uname -n`"                        # This systems hostname
36
	SERVEROSTYPE="`uname -s | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`"  # This systems operating system in lowercase
37
	XYMONOSSCRIPT="xymonclient-$SERVEROSTYPE.sh"
38
	XYMONCLIENTHOME="%%WWWDIR%%/client"
39
40
	for i in $xymon_client_flags; do
41
		case "$i" in
42
			--hostname=*)
43
				MACHINEDOTS="`echo $i | sed -e 's/--hostname=//'`"
44
				;;
45
			--os=*)
46
				SERVEROSTYPE="`echo $i | sed -e 's/--os=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`"
47
				;;
48
			--class=*)
49
				CONFIGCLASS="`echo $i | sed -e 's/--class=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`"
50
				;;
51
		esac
52
		shift
53
	done
54
55
	export MACHINEDOTS SERVEROSTYPE XYMONOSSCRIPT XYMONCLIENTHOME CONFIGCLASS
56
57
	MACHINE="`echo $MACHINEDOTS | sed -e 's/\./,/g'`"
58
	export MACHINE
59
}
60
25
run_rc_command "$1"
61
run_rc_command "$1"

Return to bug 197827