[Armadeus-commitlog] armadeus branch, master, updated. release-3.4-16-gf2ffce2
Brought to you by:
sszy
|
From: jscheer <js...@us...> - 2011-03-24 14:39:45
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via f2ffce2439c6700fa26f3b83f6119e8b217b375e (commit)
from ca5a81d788986ed3066da79c9a909cadc977a850 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f2ffce2439c6700fa26f3b83f6119e8b217b375e
Author: Jeremie Scheer <jer...@ar...>
Date: Thu Mar 24 15:39:14 2011 +0100
[PPS] [TEST] Add arguments to configure PPS' test scripts init_wpa, test_ipsec and test_ssh_tunnel.
-----------------------------------------------------------------------
Summary of changes:
buildroot/package/armadeus/pps/pps.mk | 5 +-
.../scripts/configs/wpa_supplicant/networkConfig | 22 ------
target/pps/scripts/init_wpa.sh | 20 ++----
target/pps/scripts/test_ipsec.sh | 68 ++++++++++----------
target/pps/scripts/test_ssh_tunnel.sh | 28 ++++----
5 files changed, 55 insertions(+), 88 deletions(-)
delete mode 100644 target/pps/scripts/configs/wpa_supplicant/networkConfig
diff --git a/buildroot/package/armadeus/pps/pps.mk b/buildroot/package/armadeus/pps/pps.mk
index 8febace..9eeceb5 100644
--- a/buildroot/package/armadeus/pps/pps.mk
+++ b/buildroot/package/armadeus/pps/pps.mk
@@ -38,17 +38,16 @@ ifeq ($(BR2_PACKAGE_ARMADEUS_PPS_TEST_SCRIPTS),y)
cp -Rf $(ARMADEUS-PPS_TESTSCRIPTS_WWW_DIR) $(ARMADEUS-PPS_TESTSCRIPTS_WWW_TARGET_DIR)
endif
-$(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_TARGET_DIR)/wpa_supplicant/networkConfig:
+$(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_TARGET_DIR)/ipsec-tools.conf:
ifeq ($(BR2_PACKAGE_ARMADEUS_PPS_TEST_SCRIPTS),y)
cp -Rf $(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_DIR)/* $(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_TARGET_DIR)
endif
-pps-utils: $(ARMADEUS-PPS_INITS_TARGET_DIR)/S80gpios pps-home pps-configs $(ARMADEUS-PPS_TESTSCRIPTS_TARGET_DIR)/init_boa.sh $(ARMADEUS-PPS_TESTSCRIPTS_WWW_TARGET_DIR)/www/index.html $(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_TARGET_DIR)/wpa_supplicant/networkConfig
+pps-utils: $(ARMADEUS-PPS_INITS_TARGET_DIR)/S80gpios pps-home pps-configs $(ARMADEUS-PPS_TESTSCRIPTS_TARGET_DIR)/init_boa.sh $(ARMADEUS-PPS_TESTSCRIPTS_WWW_TARGET_DIR)/www/index.html $(ARMADEUS-PPS_TESTSCRIPTS_CONFIGS_TARGET_DIR)/ipsec-tools.conf
armadeus-pps-utils-clean:
rm -rf $(ARMADEUS-PPS_TESTSCRIPTS_TARGET_DIR)
rm -rf $(ARMADEUS-PPS_WWW_TARGET_DIR)/www
- rm -rf $(ARMADEUS-PPS_CONFIGS_TARGET_DIR)/wpa_supplicant
#############################################################
#
diff --git a/target/pps/scripts/configs/wpa_supplicant/networkConfig b/target/pps/scripts/configs/wpa_supplicant/networkConfig
deleted file mode 100644
index cd387a3..0000000
--- a/target/pps/scripts/configs/wpa_supplicant/networkConfig
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# THE ARMADEUS PROJECT
-#
-# Copyright (C) 2010 The armadeus systems team [Jérémie Scheer]
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-export SSID=
-export PSK=
diff --git a/target/pps/scripts/init_wpa.sh b/target/pps/scripts/init_wpa.sh
index 6a65574..8f7c109 100644
--- a/target/pps/scripts/init_wpa.sh
+++ b/target/pps/scripts/init_wpa.sh
@@ -18,11 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-if [ -f /etc/wpa_supplicant/networkConfig ]; then
-
-source /etc/wpa_supplicant/networkConfig
-
-if [ "$SSID" != "" -a "$PSK" != "" ]; then
+if [ $# -eq 2 ]; then
#create WPA configuration
mkdir -p /etc/wpa_supplicant/
@@ -30,12 +26,12 @@ if [ "$SSID" != "" -a "$PSK" != "" ]; then
echo "ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
-ssid=\"$SSID\"
+ssid=\"$1\"
scan_ssid=1
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
-psk=\"$PSK\"
+psk=\"$2\"
}" > /etc/wpa_supplicant/wpa_supplicant.conf
#Hardware reset of wi2wi chip
@@ -60,15 +56,9 @@ psk=\"$PSK\"
echo -e "\nTo check the wifi port (eth1), please enter the command \"ping 192.168.0.251\" on the host PC\n"
echo -e "\nTo restart the WPA Supplicant, before entering the command \"sh init_wpa.sh\", or to stop it, run \"sh stop_wpa.sh\"\n"
-else #[ "$SSID" != "" -a "$PSK" != "" ]; print usage
-
- echo -e '\nThe variables SSID and PSK are not initialized in /etc/wpa_supplicant/networkConfig.\nTo correctly run WPA Supplicant, you must fill these variables in like this:\nexport SSID=mon_ssid\nexport PSK=ma_passphrase\n'
-
-fi
-
-else #[ -f /etc/wpa_supplicant/networkConfig ]; print usage
+else #[ $# -eq 2 ]
- echo -e '\nThe file /etc/wpa_supplicant/networkConfig doesnt exist.\nTo correctly run WPA Supplicant, you have to create this file and declare the variables SSID and PSK like this:\nexport SSID=mon_ssid\nexport PSK=ma_passphrase\n'
+ echo -e "\n$0: Bad arguments number\nUsage: $0 SSID PASSPHRASE\n"
fi
diff --git a/target/pps/scripts/test_ipsec.sh b/target/pps/scripts/test_ipsec.sh
index bbed72d..996a9eb 100644
--- a/target/pps/scripts/test_ipsec.sh
+++ b/target/pps/scripts/test_ipsec.sh
@@ -18,14 +18,14 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-if [ -f /etc/ipsec-tools.conf ]; then
+if [ $# -eq 1 ]; then
- #****** 1: definition *****
+ if [ -f /etc/ipsec-tools.conf ]; then
- #dont forget to edit the file /etc/ipsec-tools.conf on the system with this address
- export IPADDR=
+ #****** 1: definition *****
- if [ "$IPADDR" != "" ]; then
+ #dont forget to edit the file /etc/ipsec-tools.conf on the system with this address
+ export IPADDR=$1
#****** 2:create connection (PPS Ethernet port) ****
ifconfig usb0 down 2>/dev/null
@@ -42,42 +42,42 @@ if [ -f /etc/ipsec-tools.conf ]; then
setkey -D
echo -e "\nNow you can test the IPSec securized connection by activating it on your host PC:\n- First you have to put on your host PC in the directory /etc/ the file ipsec-tools.conf.\n- Then you can run IPSec with the command: sudo /etc/init.d/setkey start\n- On your system, you can run a telnet toward your host PC\n- Check with Wireshark on your host PC that you can't see the protocol TELNET and your password in the datagrams.\n"
- fi
- else
- echo -e '\nThe variable IPADDR is not initialized. \nYou have to fill this variable in the file /usr/local/pps/scripts/test_ipsec.sh\n'
- fi
-else
- echo -e '\nThe file /etc/ipsec-tools.conf doesnt exist.\nYou have to create this file and fill it with the correct datas, like this:\n
- ## Flush the SAD and SPD
- #
- flush;
- spdflush;
+ fi
+ else #[ -f /etc/ipsec-tools.conf ]
+ echo -e '\nThe file /etc/ipsec-tools.conf doesnt exist.\nYou have to create this file and fill it with the correct datas, like this:\n
+ ## Flush the SAD and SPD
+ #
+ flush;
+ spdflush;
- # Attention: Use this keys only for testing purposes!
- # Generate your own keys!
+ # Attention: Use this keys only for testing purposes!
+ # Generate your own keys!
- # AH SAs using 128 bit long keys
- add 192.168.0.225 192.168.0.208 ah 0x200 -A hmac-md5
- 0xc0291ff014dccdd03874d9e8e4cdf3e6;
+ # AH SAs using 128 bit long keys
+ add 192.168.0.225 192.168.0.208 ah 0x200 -A hmac-md5
+ 0xc0291ff014dccdd03874d9e8e4cdf3e6;
- add 192.168.0.208 192.168.0.225 ah 0x300 -A hmac-md5
- 0x96358c90783bbfa3d7b196ceabe0536b;
+ add 192.168.0.208 192.168.0.225 ah 0x300 -A hmac-md5
+ 0x96358c90783bbfa3d7b196ceabe0536b;
- # ESP SAs using 192 bit long keys (168 + 24 parity)
+ # ESP SAs using 192 bit long keys (168 + 24 parity)
- add 192.168.0.225 192.168.0.208 esp 0x201 -E 3des-cbc
- 0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831;
- add 192.168.0.208 192.168.0.225 esp 0x301 -E 3des-cbc
- 0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df;
+ add 192.168.0.225 192.168.0.208 esp 0x201 -E 3des-cbc
+ 0x7aeaca3f87d060a12f4a4487d5a5c3355920fae69a96c831;
+ add 192.168.0.208 192.168.0.225 esp 0x301 -E 3des-cbc
+ 0xf6ddb555acfd9d77b03ea3843f2653255afe8eb5573965df;
- # Security policies
- spdadd 192.168.0.225 192.168.0.208 any -P out ipsec
- esp/transport//require
- ah/transport//require;
+ # Security policies
+ spdadd 192.168.0.225 192.168.0.208 any -P out ipsec
+ esp/transport//require
+ ah/transport//require;
- spdadd 192.168.0.208 192.168.0.225 any -P in ipsec
- esp/transport//require
- ah/transport//require;\n'
+ spdadd 192.168.0.208 192.168.0.225 any -P in ipsec
+ esp/transport//require
+ ah/transport//require;\n'
+ fi
+else #[ $# -eq 1 ]
+ echo -e "\n$0: Bad arguments number\nUsage: $0 IPADDRESS\n"
fi
diff --git a/target/pps/scripts/test_ssh_tunnel.sh b/target/pps/scripts/test_ssh_tunnel.sh
index 32b70bc..1a0efbe 100644
--- a/target/pps/scripts/test_ssh_tunnel.sh
+++ b/target/pps/scripts/test_ssh_tunnel.sh
@@ -18,16 +18,16 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-#****** 1: definition *****
+if [ $# -eq 4 ]; then
-export USERNAME=
-export HOSTNAME=
-#dont forget to add the tunnel port to the file /etc/ssh/sshd_config on your Host PC.
-export PORTNAME= #(configure firewall and NAT for this port if necessary)
-# define tunnel id (port;standard value should be 23; avoid it because NAT config may be already used for ssh )
-export TELNETPORT=
+ #****** 1: definition *****
+ export USERNAME=$1
+ export HOSTADDRESS=$2
+ #dont forget to add the tunnel port to the file /etc/ssh/sshd_config on your Host PC.
+ export VIRTUALPORT=$3 #(configure firewall and NAT for this port if necessary)
+ # define tunnel id (port;standard value should be 23; avoid it because NAT config may be already used for ssh )
+ export TELNETPORT=$4
-if [ "$USERNAME" != "" -a "$HOSTNAME" != "" -a "$PORTNAME" != "" -a "$TELNETPORT" != "" ]; then
# ****** 2: Activate the connection interface (PPS Ethernet port) *****
ifconfig usb0 down 2>/dev/null
ifconfig eth1 down 2>/dev/null
@@ -37,18 +37,18 @@ if [ "$USERNAME" != "" -a "$HOSTNAME" != "" -a "$PORTNAME" != "" -a "$TELNETPORT
# ****** 2: create the ssh tunnel (check first if exists !!!)*****
- ps -eaf |grep "ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTNAME -p $PORTNAME" | grep -vq "grep"
- [ $? -eq 1 ] && ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTNAME -p $PORTNAME ;
+ ps -eaf |grep "ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTADDRESS -p $VIRTUALPORT" | grep -vq "grep"
+ [ $? -eq 1 ] && ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTADDRESS -p $VIRTUALPORT ;
# *** 3: start telnet (if tunnel exist!!) : !! NOTE: host name is localhost !!! ***
- ps -eaf |grep "ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTNAME -p $PORTNAME" | grep -vq "grep"
+ ps -eaf |grep "ssh -fN -L $TELNETPORT:localhost:$TELNETPORT -C $USERNAME@$HOSTADDRESS -p $VIRTUALPORT" | grep -vq "grep"
res=$?
- [ $res -eq 0 ] && echo -e "\nSSH tunnel is created on localhost, port 23. Now connecting to host $HOSTNAME with telnet.\n You can check if the tunnel is properly encrypting the datas with Wireshark: you must not see the protocol TELNET or your password in the datagrams.\n"
+ [ $res -eq 0 ] && echo -e "\nSSH tunnel is created on localhost, port 23. Now connecting to host $HOSTADDRESS with telnet.\n You can check if the tunnel is properly encrypting the datas with Wireshark: you must not see the protocol TELNET or your password in the datagrams.\n"
[ $res -eq 0 ] && telnet -l $USERNAME localhost
-else
- echo -e "\nOne or many of the variables USERNAME, HOSTNAME, PORTNAME and TELNETPORT are not initialized. \nYou have to fill these variables in the file /usr/local/pps/scripts/test_ssh_tunnel.sh\n"
+else #[ $# -eq 4 ]
+ echo -e "\n$0: Bad arguments number\nUsage: $0 USERNAME HOSTADDRESS VIRTUALPORT TELNETPORT\n"
fi
hooks/post-receive
--
armadeus
|