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
|
#!/bin/sh
set -e
. debian/tests/functions.inc
trap 'service_status NOFAIL isnsd' EXIT
# (This script is loosely based on the isnssetup example in
# open-isns's source repository.)
# make sure isnsadm sees the own server's pubkey (the key
# was autogenerated at package installation)
cp /etc/isns/auth_key.pub /etc/isns/server_key.pub
hostname=127.0.0.1
rm -f /etc/isns/control.key
echo "Registering control node policy."
isnsadm --local \
--keyfile=/etc/isns/control.key \
--enroll isns.control \
node-type=ALL functions=ALL object-type=ALL
echo "Registering control node."
isnsadm --local \
--register control
# FIXME: do we actually need a restart here?
echo "Restarting isnsd."
service isnsd restart
# Unfortunately, isnsd forks before it's 100% initialized, so wait a
# bit before trying to connect to it again, otherwise this is subject
# to a race condition.
sleep 1
echo "Registering server policy (usiung DSA auth)."
isnsadm --control \
--server $hostname \
--enroll $hostname \
key=/etc/isns/auth_key.pub \
node-type=target+initiator
trap - EXIT
echo "Success."
|