From 8cee14231c21d9eb2ad7e5e0d85c738bc8b72701 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20Mei=C3=9Fner?=
 <936176+t-nil@users.noreply.github.com>
Date: Mon, 22 Jul 2024 12:52:18 +0200
Subject: [PATCH] fix(vpn_uni): Switch path for hipreport.sh automatically

---
 vpn_uni.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/vpn_uni.sh b/vpn_uni.sh
index 246c144..0c044f4 100755
--- a/vpn_uni.sh
+++ b/vpn_uni.sh
@@ -3,16 +3,21 @@
 MTU=1284
 VPNUSER=meissnerfl73755
 VPNPASSWORD=$(cat pws/vpn_uni)
-HIREPORT=/usr/libexec/openconnect/hipreport.sh
+
+if [ -e /usr/lib/openconnect/hipreport.sh ]; then
+    HIPREPORT="/usr/lib/openconnect/hipreport.sh"
+else
+    HIPREPORT="/usr/libexec/openconnect/hipreport.sh"
+fi
+
 DEADPEERSSECS=30
 IFACE=vpn0
 
-set +o histexpand
 echo $VPNPASSWORD | sudo /usr/sbin/openconnect \
   --protocol gp \
   --syslog \
   --disable-ipv6 \
-  --csd-wrapper $HIREPORT \
+  --csd-wrapper $HIPREPORT \
   --interface $IFACE \
   --mtu $MTU \
   --force-dpd $DEADPEERSSECS \
-- 
GitLab