-
Notifications
You must be signed in to change notification settings - Fork 899
/
rd-jobs
executable file
·43 lines (37 loc) · 1006 Bytes
/
rd-jobs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
errorMsg() {
echo "$*" 1>&2
}
log () {
echo ${1}: ${2}
}
#
# This hack checks if this shell script was called within (most probably) a cygwin context
# during an ssh to a windows box and if so, to actually exec the .bat batch file instead.
#
if [ -n "$OS" -a "$OS" = "Windows_NT" ]
then
exec cmd.exe /C $RDECK_HOME/bin/rd-jobs.bat "$@"
fi
# Look for parent directory
PDIR=$(cd `dirname $0/`/../.. && pwd)
if [ -r $RDECK_BASE/etc/framework.properties ]; then
. $RDECK_BASE/etc/profile
elif [ -r /etc/rundeck/client/profile ]; then
. /etc/rundeck/client/profile
elif [ -r "$PDIR/etc/profile" ]; then
. $PDIR/etc/profile
fi
if [ "${RDECK_BASE}X" = "X" ]; then
errorMsg "Unable to determine RDECK_BASE."
exit 1
fi
#
# Launch the cmdline tool
#
exec ${JAVA_CMD:-java} ${RDECK_JVM} -classpath ${CLI_CP} \
-Duser.java_home=$JAVA_HOME \
-Drdeck.base=$RDECK_BASE \
-Drdeck.home=$RDECK_HOME \
$RDECK_SSL_OPTS \
com.dtolabs.rundeck.core.cli.jobs.JobsTool "$@"