From: <abe...@us...> - 2013-02-23 21:26:40
|
Revision: 5965 http://astlinux.svn.sourceforge.net/astlinux/?rev=5965&view=rev Author: abelbeck Date: 2013-02-23 21:26:30 +0000 (Sat, 23 Feb 2013) Log Message: ----------- openvpn, for client add user/pass authentication via new OVPNC_USER_PASS variable Modified Paths: -------------- branches/1.0/package/openvpn/openvpnclient.init branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/package/openvpn/openvpnclient.init =================================================================== --- branches/1.0/package/openvpn/openvpnclient.init 2013-02-23 15:43:26 UTC (rev 5964) +++ branches/1.0/package/openvpn/openvpnclient.init 2013-02-23 21:26:30 UTC (rev 5965) @@ -8,6 +8,8 @@ lock="/var/lock/openvpnclient.lock" # PID pid="/var/run/openvpnclient.pid" +# PSK file for optional OVPNC_USER_PASS +psk="/tmp/etc/openvpnclient-psk.txt" init () { local IFS @@ -73,6 +75,12 @@ if [ -n "$OVPNC_AUTH" ]; then echo "auth $OVPNC_AUTH" >> /tmp/etc/openvpnclient.conf fi + if [ -n "$OVPNC_USER_PASS" ]; then + echo "$OVPNC_USER_PASS" | awk -F' ' '{ print $1; }' > $psk + echo "$OVPNC_USER_PASS" | awk -F' ' '{ print $2; }' >> $psk + chmod 600 $psk + echo "auth-user-pass $psk" >> /tmp/etc/openvpnclient.conf + fi if [ -n "$OVPNC_NSCERTTYPE" ]; then echo "ns-cert-type $OVPNC_NSCERTTYPE" >> /tmp/etc/openvpnclient.conf fi @@ -97,7 +105,7 @@ if [ -f $lock ]; then # we were not shut down correctly kill $(cat $pid) >/dev/null 2>&1 - rm -f $pid $lock + rm -f $pid $lock $psk sleep 2 fi @@ -117,7 +125,7 @@ if [ -f $pid ]; then echo "Stopping OpenVPN Client..." kill $(cat $pid) >/dev/null 2>&1 - rm -f $pid $lock + rm -f $pid $lock $psk fi } Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-23 15:43:26 UTC (rev 5964) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2013-02-23 21:26:30 UTC (rev 5965) @@ -572,6 +572,8 @@ #OVPNC_CIPHER="AES-128-CBC" ## Define the Auth HMAC, defaults to SHA1 if not defined, the server's setting must match #OVPNC_AUTH="SHA256" +## Enable User/Pass authentication using space separated user & pass" +#OVPNC_USER_PASS="user pass" ## Define ns-cert-type if set #OVPNC_NSCERTTYPE="server" ## Allow OpenVPN Client tunnel to one LAN Interface, defaults to disallow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |