From 9ef1a8b186c76fe00a9f72afa29c8544bbbf06cc Mon Sep 17 00:00:00 2001 From: Andrew Holland Date: Sat, 16 Sep 2017 01:43:31 +0300 Subject: [PATCH] bournified and added write option/default just shows --- fixdns.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fixdns.sh b/fixdns.sh index 9ba2ad3..dd34ab9 100755 --- a/fixdns.sh +++ b/fixdns.sh @@ -1,5 +1,9 @@ -#!/bin/zsh -cd /tmp/ +#!/bin/sh +cd /tmp/ || exit 'cd did not work' curl -o resolv.conf -L "https://api.opennicproject.org/geoip/?resolv&ipv=4" -sudo mv resolv.conf /etc/ +if [ "$1" = 'write' ]; then + sudo mv resolv.conf /etc/ +else + less resolv.conf +fi