... | ... |
@@ -10,13 +10,6 @@ if [[ $EUID -ne 0 ]]; then |
10 | 10 |
exit 1 |
11 | 11 |
fi |
12 | 12 |
|
13 |
-# Make sure user has configured an ssh pubkey |
|
14 |
-if [ ! -e /root/.ssh/id_rsa.pub ]; then |
|
15 |
- echo "Public key is missing. This is used to ssh into your instances." |
|
16 |
- echo "Please run ssh-keygen before proceeding" |
|
17 |
- exit 1 |
|
18 |
-fi |
|
19 |
- |
|
20 | 13 |
# This directory |
21 | 14 |
CUR_DIR=$(cd $(dirname "$0") && pwd) |
22 | 15 |
|
... | ... |
@@ -42,6 +35,13 @@ if [ ! -e /var/lib/jenkins ]; then |
42 | 42 |
exit 1 |
43 | 43 |
fi |
44 | 44 |
|
45 |
+# Make sure user has configured a jenkins ssh pubkey |
|
46 |
+if [ ! -e /var/lib/jenkins/.ssh/id_rsa.pub ]; then |
|
47 |
+ echo "Public key for jenkins is missing. This is used to ssh into your instances." |
|
48 |
+ echo "Please run "su -c ssh-keygen jenkins" before proceeding" |
|
49 |
+ exit 1 |
|
50 |
+fi |
|
51 |
+ |
|
45 | 52 |
# Setup sudo |
46 | 53 |
JENKINS_SUDO=/etc/sudoers.d/jenkins |
47 | 54 |
cat > $JENKINS_SUDO <<EOF |