mirror of
https://github.com/shokinn/.files.git
synced 2025-01-18 21:22:25 +00:00
add option to show the current configuration
This commit is contained in:
parent
4fe8838769
commit
e5ca559150
|
@ -206,6 +206,7 @@ confv6::unset() {
|
||||||
unset prefixlength
|
unset prefixlength
|
||||||
unset router
|
unset router
|
||||||
unset help
|
unset help
|
||||||
|
unset show
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,6 +226,7 @@ confv6() {
|
||||||
# option names without duplicating any information.
|
# option names without duplicating any information.
|
||||||
zparseopts -D -F -K -- \
|
zparseopts -D -F -K -- \
|
||||||
{h,-help}=help \
|
{h,-help}=help \
|
||||||
|
{s,-show}=show \
|
||||||
{n,-network-service-name}:=service \
|
{n,-network-service-name}:=service \
|
||||||
{c,-configuration}:=configuration \
|
{c,-configuration}:=configuration \
|
||||||
{a,-address}:=address \
|
{a,-address}:=address \
|
||||||
|
@ -276,6 +278,12 @@ confv6() {
|
||||||
router=${(q+)router[-1]/=}
|
router=${(q+)router[-1]/=}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (( $#show )); then
|
||||||
|
networksetup -getinfo "${service}"
|
||||||
|
confv6::unset
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${configuration} == "automatic" || -z ${configuration} ]]; then
|
if [[ ${configuration} == "automatic" || -z ${configuration} ]]; then
|
||||||
networksetup -setv6automatic "${service}"
|
networksetup -setv6automatic "${service}"
|
||||||
networksetup -getinfo "${service}"
|
networksetup -getinfo "${service}"
|
||||||
|
|
Loading…
Reference in a new issue