From: Frank Brehm Date: Wed, 22 Apr 2020 06:14:53 +0000 (+0200) Subject: Start checking preferences in bin/start-openfortivpn X-Git-Tag: 0.1.2~5^2~4 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f9ed4b84e5435d1588d5f76d4f7ef0ba9b458372;p=pixelpark%2Fadmin-tools.git Start checking preferences in bin/start-openfortivpn --- 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