File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
skeleton-common/usr/local/sbin Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 11
11
ssh-keygen -t ed25519 -N ' ' -f /etc/ssh/ssh_host_ed25519_key || true &
12
12
wait ` jobs -p` || true
13
13
fi
14
+ oc-userdata ssh-host-fingerprints " ` cat /etc/ssh/ssh_host_* pub` " binary
Original file line number Diff line number Diff line change @@ -14,20 +14,26 @@ get() {
14
14
RESPONSE=$( curl --local-port 1-1024 --silent --write-out " \n%{http_CODE}\n" $URL )
15
15
CODE=$( echo " $RESPONSE " | sed -n ' $p' )
16
16
BODY=$( echo " $RESPONSE " | sed ' $d' )
17
- echo " $BODY "
17
+ echo " $BODY "
18
18
else
19
- echo " 'curl' dependency is missing." >&2
19
+ echo " 'curl' dependency is missing." >&2
20
20
fi
21
21
}
22
22
23
23
patch () {
24
24
URL=" $1 "
25
25
DATA=" $2 "
26
+ TYPEDATA=" -d"
27
+
28
+ if [ " $3 " = " binary" ]; then
29
+ TYPEDATA=" --data-binary"
30
+ fi
31
+
26
32
if type curl > /dev/null 2> /dev/null; then
27
33
# Using curl
28
- RESPONSE=$( curl --local-port 1-1024 -X PATCH -d " $DATA " -H " Content-Type: text/plain" --silent --write-out " \n%{http_CODE}\n" $URL )
34
+ RESPONSE=$( curl --local-port 1-1024 -X PATCH $TYPEDATA " $DATA " -H " Content-Type: text/plain" --silent --write-out " \n%{http_CODE}\n" $URL )
29
35
else
30
- echo " 'curl' dependency is missing." >&2
36
+ echo " 'curl' dependency is missing." >&2
31
37
fi
32
38
}
33
39
37
43
if [ " $2 " = " " ]; then
38
44
get " $USERDATA_URL /$1 "
39
45
else
40
- patch " $USERDATA_URL /$1 " " $2 "
46
+ patch " $USERDATA_URL /$1 " " $2 " $3
41
47
fi
42
48
fi
You can’t perform that action at this time.
0 commit comments