Changeset 13840


Ignorieren:
Zeitstempel:
30.07.2016 12:53:35 (vor 16 Monaten)
Autor:
MaxMuster
Nachricht:

openvpn-cgi:

  • fix for overwritten config files after itroduction of DAEMON_CONFIG in changeset:12296
  • using fix proposed by user no.herbert
  • refs #2850
Ort:
trunk/make/openvpn-cgi/files/root/etc
Dateien:
2 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/make/openvpn-cgi/files/root/etc/default.openvpn/openvpn_conf

    r10954 r13840  
    4040done 
    4141 
     42if [ "$TAP2LAN" = uselanip ]; then 
     43    LANIPANDMASK="$(ifconfig lan | sed -n '/inet addr/ s/.*inet addr:\([0-9\.]*\) .*Mask:\([0-9\.]*\)/\1 \2/ p')" 
     44    if [ "${LANIPANDMASK//[0-9]/}" != "... ..." ]; then  
     45        echo "No valid LAN-IP found. EXIT" >&2 
     46        return 
     47    fi 
     48    BOX_IP=${LANIPANDMASK% *} 
     49    BOX_MASK=${LANIPANDMASK#* } 
     50fi 
     51 
    4252if [ "openvpn_$CONFIG_NAMES" = "$prefix" ] || [ "$prefix" = "openvpn" -a  $count -eq 1 ]; then 
    4353 
    4454[ "${TYPE}_${CLIENT_INFO}_${AUTH_TYPE}" = "tun_yes_certs" ] && TUNSUBNET=true || TUNSUBNET="" 
    4555 
    46 echo "#  OpenVPN 2.1 Config, $(date)" 
     56openvpn --version | sed "s/^/#/" 
     57echo "#  Config date: $(date)" 
    4758 
    4859[ "$IPV6" = yes ] && V6=6 || V6="" 
     
    5667    echo "dev tap$(( $count -1))" 
    5768    [ "$TAP2LAN" = yes ] && echo "#Helperline for rc.openvpn to add tap$(( $count -1)) to lan bridge" 
     69    [ "$TAP2LAN" = uselanip ] && echo "#Helperline for rc.openvpn to add tap$(( $count -1)) to lan bridge and use LAN IP" 
    5870else 
    5971    echo "dev tun" 
     
    101113 
    102114    if [ "$TYPE" = "tap" ] || [ $TUNSUBNET ]; then 
    103         echo "ifconfig $BOX_IP $BOX_MASK" 
     115        [ "$TAP2LAN" != uselanip ] && echo "ifconfig $BOX_IP $BOX_MASK" 
    104116        echo "push \"route-gateway $BOX_IP\"" 
    105117        [ $TUNSUBNET ] && echo -e 'topology subnet\npush "topology subnet"' 
  • trunk/make/openvpn-cgi/files/root/etc/init.d/rc.openvpn

    r12813 r13840  
    106106            DAEMON_LONG_NAME=$DAEMON 
    107107            DAEMON_BIN=$DAEMON 
     108            DAEMON_CONFIG=/mod/etc/${DAEMON}.conf 
    108109            PID_FILE=/var/run/${DAEMON_BIN}.pid 
    109110            modlib_start $TMP_ENABLE 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.