Zsh: Add IP option to get_ip()

This commit is contained in:
the_4n0nym0u53 2022-03-07 22:58:27 +01:00
parent 6dc6ca0e3f
commit 08c4c211ab
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB

View file

@ -1,5 +1,6 @@
doasedit() {
(( ${+commands[doas]} )) || return 1
doas -L
doas $EDITOR /etc/doas.conf
doas doas -C /etc/doas.conf && echo "ok" || echo "error"
@ -8,7 +9,16 @@ doasedit() {
get_ip() {
(( ${+commands[wget]} )) || return 1
wget $@ -qO- "https://ifconfig.co/json"
local IP=""
local ARGS=""
while [[ $# -gt 0 ]]; do
[[ $1 == --ip ]] && IP="?ip=$2" && shift || ARGS="$ARGS $1"
shift
done
eval "wget $ARGS -qO- 'https://ifconfig.co/json$IP'"
}
pz_upgrade() {