diff --git a/dotfiles/commonfunc b/dotfiles/commonfunc index b4702bd..09869f5 100644 --- a/dotfiles/commonfunc +++ b/dotfiles/commonfunc @@ -206,6 +206,7 @@ confv6::unset() { unset prefixlength unset router unset help + unset show return } @@ -225,6 +226,7 @@ confv6() { # option names without duplicating any information. zparseopts -D -F -K -- \ {h,-help}=help \ + {s,-show}=show \ {n,-network-service-name}:=service \ {c,-configuration}:=configuration \ {a,-address}:=address \ @@ -276,6 +278,12 @@ confv6() { router=${(q+)router[-1]/=} fi + if (( $#show )); then + networksetup -getinfo "${service}" + confv6::unset + return + fi + if [[ ${configuration} == "automatic" || -z ${configuration} ]]; then networksetup -setv6automatic "${service}" networksetup -getinfo "${service}"