X-Git-Url: https://git.madduck.net/code/vinst.git/blobdiff_plain/c5d7227a2c01b7ca53d7cd135d930d57ce43f004..371c3a846758cc0ef0aa0c7ecd9fc5071b7725ad:/vinst diff --git a/vinst b/vinst index 9a8eb90..c6abe72 100755 --- a/vinst +++ b/vinst @@ -35,6 +35,22 @@ while [ -n "$1" ]; do esac IPADDRESS="$1" ;; + (-d|--dns) + shift + if [ -z "$1" ]; then + echo >&2 'E: --dns/-d needs IP address' + exit 1 + fi + NAMESERVER="$1" + ;; + (-g|--gateway) + shift + if [ -z "$1" ]; then + echo >&2 'E: --gateway/-g needs IP address' + exit 1 + fi + GATEWAY="$1" + ;; (-r|--ram) shift if [ -z "$1" ]; then @@ -70,7 +86,7 @@ hostname=${HOSTNAME%%.*} \ domain=${HOSTNAME#*.}" if [ -n "$IPADDRESS" ]; then - if [ -z "$GATEWAY" ]; then + if [ -z "$GATEWAY" ] && [ -x $(command -v ipcalc) ]; then # default to the first IP in the network GATEWAY=$(ipcalc $IPADDRESS | grep HostMin | awk '{print $2}') fi