File: auth

package info (click to toggle)
open-isns 0.101-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,440 kB
  • sloc: ansic: 19,981; sh: 3,211; python: 1,083; perl: 839; makefile: 214
file content (45 lines) | stat: -rwxr-xr-x 1,090 bytes parent folder | download | duplicates (7)
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."