Add local IP support to Linux and Windows
This commit is contained in:
parent
73d50eb6b8
commit
3e9975c438
1 changed files with 20 additions and 0 deletions
20
fetch
20
fetch
|
@ -1335,6 +1335,26 @@ getbattery () {
|
|||
|
||||
# }}}
|
||||
|
||||
# IP Address {{{
|
||||
|
||||
getlocalip () {
|
||||
case "$os" in
|
||||
"Linux")
|
||||
localip="$(ip route get 1 | awk '{print $NF;exit}')"
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')"
|
||||
;;
|
||||
|
||||
*)
|
||||
localip="Unknown"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# }}}
|
||||
|
||||
# Birthday {{{
|
||||
|
||||
getbirthday () {
|
||||
|
|
Loading…
Reference in a new issue