From: <dha...@us...> - 2007-02-17 20:31:58
|
Revision: 591 http://svn.sourceforge.net/astlinux/?rev=591&view=rev Author: dhartman Date: 2007-02-17 12:31:50 -0800 (Sat, 17 Feb 2007) Log Message: ----------- openvpn updates Modified Paths: -------------- trunk/package/openvpn/easy-rsa.tar.gz trunk/package/openvpn/openvpn.init trunk/target/generic/target_skeleton/stat/etc/rc.conf Removed Paths: ------------- trunk/target/generic/target_skeleton/etc/openvpn trunk/target/generic/target_skeleton/etc/openvpn.conf Modified: trunk/package/openvpn/easy-rsa.tar.gz =================================================================== (Binary files differ) Modified: trunk/package/openvpn/openvpn.init =================================================================== --- trunk/package/openvpn/openvpn.init 2007-02-16 17:50:10 UTC (rev 590) +++ trunk/package/openvpn/openvpn.init 2007-02-17 20:31:50 UTC (rev 591) @@ -17,6 +17,9 @@ modprobe tun fi +# create initial link from /tmp/etc/openvpn.conf to /etc/openvpn.conf +ln -sf /tmp/etc/openvpn.conf /etc/openvpn.conf + if [ -d /mnt/kd/openvpn ] then ln -s /mnt/kd/openvpn /tmp/etc/openvpn @@ -27,20 +30,53 @@ exit fi +if [ -f /mnt/kd/openvpn/openvpn.conf ] +then +echo "Using OpenVPN config file from keydisk" +ln -sf /mnt/kd/openvpn/openvpn.conf /tmp/etc/openvpn.conf +else echo "Creating OpenVPN config files" echo "#openvpn.conf created from rc.conf settings dynamically at boot dev $OVPN_DEV +port $OVPN_PORT proto $OVPN_PROTOCOL ca $OVPN_CA cert $OVPN_CERT key $OVPN_KEY dh $OVPN_DH server $OVPN_SERVER -verb $OVPN_VERBOSITY -push \"$OVPN_PUSH1 $OVPN_PUSH2 $OVPN_PUSH3\"" > /tmp/etc/openvpn.conf - +verb $OVPN_VERBOSITY" > /tmp/etc/openvpn.conf +# push settings from the server to the client +if [ "$OVPN_PUSH1" ] +then +echo "push \"$OVPN_PUSH1\"" >> /tmp/etc/openvpn.conf +fi +if [ "$OVPN_PUSH2" ] +then +echo "push \"$OVPN_PUSH2\"" >> /tmp/etc/openvpn.conf +fi +if [ "$OVPN_PUSH3" ] +then +echo "push \"$OVPN_PUSH3\"" >> /tmp/etc/openvpn.conf +fi +if [ "$OVPN_PUSH4" ] +then +echo "push \"$OVPN_PUSH4\"" >> /tmp/etc/openvpn.conf +fi +if [ "$OVPN_OTHER1" ] +then +echo "$OVPN_OTHER1" >> /tmp/etc/openvpn.conf +fi +if [ "$OVPN_OTHER2" ] +then +echo "$OVPN_OTHER2" >> /tmp/etc/openvpn.conf +fi +if [ "$OPVN_LZO" -a "OVPN_LZO" = "yes" ] +then +echo "comp-lzo" >> /tmp/etc/openvpn.conf +fi +# Static settings -- fine for most users echo "#static setting--modify openvpn init script to change -port 1194 ifconfig-pool-persist /etc/openvpn/ipp.txt user nobody group nobody @@ -49,22 +85,52 @@ status /var/log/openvpn-status.log log-append /var/log/openvpn.log daemon" >> /tmp/etc/openvpn.conf + +# Lockfile +lock="/var/lock/openvpn.lock" +# PID +pid="/var/run/openvpn.pid" + fi } start () { -if [ -f /tmp/etc/openvpn.conf ] +if [ -f $lock ]; then +# we were not shut down correctly +kill `cat $pid` >/dev/null 2>&1 +rm -f $pid +rm -f $lock +sleep 2 +fi + +if [ -f /etc/openvpn.conf ] then -echo "Starting OpenVPN with settings from /etc/openvpn" -/usr/sbin/openvpn /etc/openvpn.conf +echo "Starting OpenVPN with settings from /etc/openvpn.conf" +/usr/sbin/openvpn --writepid $pid --config /etc/openvpn.conf + if [ $? = 0 ]; then + success=1 + else + errors=1 + fi + done + if [ $errors = 1 ]; then + failure; echo + else + success; echo + fi + if [ $success = 1 ]; then + touch $lock + fi fi } stop () { -if [ -f /tmp/etc/openvpn.conf ] +if [ -f $pid ] then echo "Stopping OpenVPN" -killall openvpn +kill `cat $pid` > /dev/null 2>&1 +rm -f $pid +rm -f $lock fi } Deleted: trunk/target/generic/target_skeleton/etc/openvpn =================================================================== --- trunk/target/generic/target_skeleton/etc/openvpn 2007-02-16 17:50:10 UTC (rev 590) +++ trunk/target/generic/target_skeleton/etc/openvpn 2007-02-17 20:31:50 UTC (rev 591) @@ -1 +0,0 @@ -link /tmp/etc/openvpn \ No newline at end of file Deleted: trunk/target/generic/target_skeleton/etc/openvpn.conf =================================================================== --- trunk/target/generic/target_skeleton/etc/openvpn.conf 2007-02-16 17:50:10 UTC (rev 590) +++ trunk/target/generic/target_skeleton/etc/openvpn.conf 2007-02-17 20:31:50 UTC (rev 591) @@ -1 +0,0 @@ -link /tmp/etc/openvpn.conf \ No newline at end of file Modified: trunk/target/generic/target_skeleton/stat/etc/rc.conf =================================================================== --- trunk/target/generic/target_skeleton/stat/etc/rc.conf 2007-02-16 17:50:10 UTC (rev 590) +++ trunk/target/generic/target_skeleton/stat/etc/rc.conf 2007-02-17 20:31:50 UTC (rev 591) @@ -517,8 +517,11 @@ ##Suggest using the "easy-rsa" scripts that come with OpenVPN ##Perhaps on different machine, then copy the appropriate files ##Hopefully these can be created with a web interface in the future. +## NOTE: if you are using astlinux in pbx only mode, you must enable ip_forwarding +## Both astfw and arno's firewall do this for you. ##VPN above must be openvpn #OVPN_DEV="tun" +#OVPN_PORT="1194" #OVPN_PROTOCOL="udp" #OVPN_CA="/etc/openvpn/easy-rsa/keys/ca.crt" #OVPN_CERT="/etc/openvpn/easy-rsa/keys/server.crt" @@ -529,6 +532,12 @@ #OVPN_PUSH1="route 192.168.0.0 255.255.255.0" #OVPN_PUSH2="" #OVPN_PUSH3="" +#OVPN_PUSH4="" +#OVPN_OTHER1="" +#OVPN_OTHER2="" +## Enable LZO compression on thevpn yes|no +## Requires additional cpu resources +#OVPN_LZO="yes" ##Stunnel support. If your AstLinux build has been built with ##Stunnel, you can setup local stunnel connections here like so: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |