From f9ed4b84e5435d1588d5f76d4f7ef0ba9b458372 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 22 Apr 2020 08:14:53 +0200 Subject: [PATCH] Start checking preferences in bin/start-openfortivpn --- bin/start-openfortivpn | 22 ++++++++++++++++++++++ dns/resolv.conf.dpx | 5 +++++ dns/resolv.conf.non-dpx | 5 +++++ 3 files changed, 32 insertions(+) create mode 100644 dns/resolv.conf.dpx create mode 100644 dns/resolv.conf.non-dpx diff --git a/bin/start-openfortivpn b/bin/start-openfortivpn index 8feb7d3..d7607a9 100755 --- a/bin/start-openfortivpn +++ b/bin/start-openfortivpn @@ -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 index 0000000..5196b4c --- /dev/null +++ b/dns/resolv.conf.dpx @@ -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 index 0000000..4fc6eea --- /dev/null +++ b/dns/resolv.conf.non-dpx @@ -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 -- 2.39.5