summaryrefslogtreecommitdiffstats
path: root/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup')
-rwxr-xr-xrecipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup47
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup b/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup
new file mode 100755
index 0000000..9e6fa7f
--- /dev/null
+++ b/recipes-connectivity/ipsec-demo/ipsec-demo/test_setkey/setup
@@ -0,0 +1,47 @@
1# setup - quick setup for left or right side of ipsec test
2# see README for example use.
3
4SCRIPT_HOME=/test_setkey/
5cd $SCRIPT_HOME
6
7export PATH=$SCRIPT_HOME:$PATH
8
9if [ "$1" != "left" -a "$1" != "right" ] ; then
10 echo "Usage: $0 side [config] [driver]"
11 echo " where side is either left or right."
12 echo " where config is either"
13 echo " aes-sha1-tunnel (default)"
14 echo " or 3des-sha1-tunnel"
15 echo " if driver is supplied, script does 'modprobe driver'"
16 exit 1
17fi
18
19SIDE=$1
20POLICY_CFG=$SIDE.conf
21DEFAULT_POLICY=aes-sha1-tunnel
22
23if [ -n "$2" ] ; then
24 POLICY=$2
25else
26 POLICY=$DEFAULT_POLICY
27fi
28
29SETKEY_FILE=$POLICY_CFG-$POLICY
30
31if [ ! -f $SETKEY_FILE ] ; then
32 echo "Missing setkey command file: $SETKEY_FILE"
33 exit 1
34fi
35
36# modprobe any driver name given as last parameter
37if [ -n "$3" ] ; then
38 modprobe $3
39fi
40
41SETUP_CMD_FILE=./setup_$SIDE
42. $SETUP_CMD_FILE
43
44$SETKEY_FILE
45
46setkey -D
47setkey -D -P