/usr/lib/osp/enroll.sh is in osptoolkit 4.13.0-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #!/bin/sh
####################################################################
# #
# enroll.sh #
# #
####################################################################
# #
# This shell script is used to enroll the device with the Server #
####################################################################
ospdir=/usr/lib/osp
cnfdir=/etc/osp
OPENSSL_CONF=$cnfdir/openssl.cnf
export OPENSSL_CONF
RANDFILE=./.rnd
export RANDFILE
if [ $# -le 0 ]; then
echo "Usage: <script name> <list of osp server ip addresses>"
exit 127
fi
openssl req -outform PEM -nodes -newkey rsa:512 -md5 -new -out certreq.pem -keyform PEM -keyout pkey.pem
ret_val=$?
export ret_val
echo ""
echo "Error Code returned from openssl command :" $ret_val
if [ "$ret_val" != "0" ]; then
echo "Request Failed"
exit 127
fi
$ospdir/enroll -function getcacert -caurl http://$1:5045/tep > cacert_0.pem
ret_val=$?
export ret_val
echo "[SP: $1]Error Code returned from getcacert command :" $ret_val
if [ "$ret_val" != "0" ]; then
echo "Request Failed"
exit 127
fi
$ospdir/enroll -function request -username trans -password nexus -customer 1000 -device 1000 -cacert cacert_0.pem -certreq certreq.pem -sslurl https://$1:1443/tep > localcert.pem
ret_val=$?
export ret_val
echo "Error Code returned from localcert command :" $ret_val
if [ "$ret_val" != "0" ]; then
echo "Request Failed"
exit 127
fi
i=1
shift
while [ $# -ge 1 ]; do
$ospdir/enroll -function getcacert -caurl http://$1:5045/tep > cacert_$i.pem
ret_val=$?
export ret_val
echo "[SP: $1]Error Code returned from getcacert command :" $ret_val
if [ "$ret_val" != "0" ]; then
echo "Request Failed"
exit 127
fi
i=`expr $i + 1`
shift
done
|