openconnect: Restore support for vpnc-script hooks

* Restore hooks support from vpnc-script
* Use consistent style for tests and blocks in openconnect.sh
* Cleanup code that writes banner to syslog

Signed-off-by: Matthew Sykes <matthew.sykes@gmail.com>
This commit is contained in:
Matthew Sykes
2014-12-20 10:56:53 -05:00
parent d380629477
commit f2fb6217ab
2 changed files with 25 additions and 6 deletions
+5 -5
View File
@@ -40,14 +40,14 @@ proto_openconnect_setup() {
[ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem"
[ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
if test -f /etc/openconnect/ca-vpn-$config.pem;then
[ -f /etc/openconnect/ca-vpn-$config.pem ] && {
append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
append cmdline "--no-system-trust"
fi
if test -n "$serverhash";then
}
[ -n "$serverhash" ] && {
append cmdline " --servercert=$serverhash"
append cmdline "--no-system-trust"
fi
}
[ -n "$authgroup" ] && append cmdline "--authgroup $authgroup"
[ -n "$username" ] && append cmdline "-u $username"
[ -n "$password" ] && {
@@ -63,7 +63,7 @@ proto_openconnect_setup() {
proto_export INTERFACE="$config"
logger -t openconnect "executing 'openconnect $cmdline'"
if [ -f "$pwfile" ];then
if [ -f "$pwfile" ]; then
proto_run_command "$config" /usr/sbin/openconnect-wrapper $pwfile $cmdline
else
proto_run_command "$config" /usr/sbin/openconnect $cmdline