]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Start checking preferences in bin/start-openfortivpn
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 22 Apr 2020 06:14:53 +0000 (08:14 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 22 Apr 2020 06:14:53 +0000 (08:14 +0200)
bin/start-openfortivpn
dns/resolv.conf.dpx [new file with mode: 0644]
dns/resolv.conf.non-dpx [new file with mode: 0644]

index 8feb7d3735be2bce948b97a748bd923c23b411f1..d7607a9b8ffb5762c77258411955a774acb0663e 100755 (executable)
@@ -29,6 +29,8 @@ DESCRIPTION=$( cat <<-EOF
 
        It uses for this the mandatory files '${GREEN}${RESOLV_CONF_DPX}${NORMAL}' and '${GREEN}${RESOLV_CONF_NON_DPX}${NORMAL}'."
 
+       You must be root to execute this script.
+
        EOF
 )
 
@@ -86,12 +88,32 @@ get_options() {
 
 }
 
+#------------------------------------------------------------------------------
+check_preferences() {
+
+    info "Checking preferences ..."
+    local all_ok="y"
+
+    debug "Checking for openfortivpn ..."
+    if type -p openfortivpn >/dev/null ; then
+        debug "Found openfortivpn in '$( type -p openfortivpn )'."
+    else
+        all_ok="n"
+        error "Did not found openfortivpn. Maybe not installed?"
+    fi
+
+    if [[ "${all_ok}" != "y" ]] ; then
+        exit 5
+    fi
+}
+
 #------------------------------------------------------------------------------
 main() {
 
     get_options "$@"
     umask 0022
 
+    check_preferences
 }
 
 main "$@"
diff --git a/dns/resolv.conf.dpx b/dns/resolv.conf.dpx
new file mode 100644 (file)
index 0000000..5196b4c
--- /dev/null
@@ -0,0 +1,5 @@
+search pixelpark.net pixelpark.com pixelpark.de brehm-online.com uhu-banane.net pp-dns.com
+nameserver 77.74.232.24
+nameserver 77.74.232.25
+nameserver 93.188.104.82
+options edns0 timeout:1 attempts:2 use-vc
diff --git a/dns/resolv.conf.non-dpx b/dns/resolv.conf.non-dpx
new file mode 100644 (file)
index 0000000..4fc6eea
--- /dev/null
@@ -0,0 +1,5 @@
+search pixelpark.net pixelpark.com pixelpark.de brehm-online.com uhu-banane.net pp-dns.com
+nameserver 1.1.1.1
+nameserver 8.8.8.8
+nameserver 8.8.4.4
+options edns0 timeout:1 attempts:2 use-vc