summaryrefslogtreecommitdiffstats
path: root/utils/jenkins-jnlp-connect.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/jenkins-jnlp-connect.sh')
-rwxr-xr-xutils/jenkins-jnlp-connect.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/jenkins-jnlp-connect.sh b/utils/jenkins-jnlp-connect.sh
index d268a28de..4b710cab2 100755
--- a/utils/jenkins-jnlp-connect.sh
+++ b/utils/jenkins-jnlp-connect.sh
@@ -38,6 +38,11 @@ main () {
exit 1
fi
+ if [[ $(pwd) != "$jenkinshome" ]]; then
+ echo "This script needs to be run from the jenkins users home dir"
+ exit 1
+ fi
+
if [[ -z $slave_name || -z $slave_secret ]]; then
echo "slave name or secret not defined, please edit this file to define it"
exit 1
@@ -49,8 +54,8 @@ main () {
fi
if [[ $(whoami) != "root" ]]; then
- if grep "^Defaults requiretty" /etc/sudoers
- then echo "please comment out Defaults requiretty from /etc/sudoers"
+ if sudo -l | grep "requiretty"; then
+ echo "please comment out Defaults requiretty from /etc/sudoers"
exit 1
fi
fi