A workaround is the attached script.

-- 
 .''`.   martin f. krafft <[EMAIL PROTECTED]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
#!/bin/sh
#
# route-peer -- set an explicit route to peer via default gateway
#
# In OpenVPN server configuration file:
#   up "./route-peer add"
#   down "./route-peer del"
#
# Note that the down hook will not work if --user is used in the configuration
# to drop root privileges. So either 'user nobody' or the down hook.
#
# Copyright © martin f. krafft <[EMAIL PROTECTED]>
# Released under the Artistic Licence 2.0
#
set -eu

case "${1:?No action specified.}" in
  add)
    ret=0
    route add -host $trusted_ip gw $route_net_gateway || ret=$?
    case "$ret" in
      (0|7) exit 0;; # ret=7 happens if route already exists
      (*) exit $ret;;
    esac
    ;;
  del) exec route del -host $trusted_ip;;
  *) echo "Unknown action: $1" >&2; exit 1;;
esac

Attachment: signature.asc
Description: Digital signature (GPG/PGP)

Reply via email to