Replace deprecated `hostname` command
This commit is contained in:
parent
a5474bd976
commit
c8ec4e2996
6
zshrc
6
zshrc
|
@ -336,9 +336,9 @@ alias rd='rmdir'
|
||||||
#Internet
|
#Internet
|
||||||
## Minimal webserver from current directory and available at http://IP.AD.RE.SS:8002
|
## Minimal webserver from current directory and available at http://IP.AD.RE.SS:8002
|
||||||
## See : https://docs.python.org/3/library/http.server.html
|
## See : https://docs.python.org/3/library/http.server.html
|
||||||
alias httpserv='python3 -m http.server -b $(hostname -i) 8002'
|
alias httpserv="python3 -m http.server -b $(ip route get 1 | awk '{print $(NF-2);exit}') 8002"
|
||||||
## Minimal webserver with upload option and storage in dedicated directory
|
## Minimal webserver with upload option and storage in dedicated directory
|
||||||
alias httpup="mkdir --parent -- /tmp/http.upload.directory && cd -- /tmp/http.upload.directory && python3 ${HOME}/bin/upload-http-server.py --listen $(hostname -i) --port 8004"
|
alias httpup="mkdir --parent -- /tmp/http.upload.directory && cd -- /tmp/http.upload.directory && python3 ${HOME}/bin/upload-http-server.py --listen $(ip route get 1 | awk '{print $(NF-2);exit}') --port 8004"
|
||||||
|
|
||||||
## Limite l'envoi à 3 requêtes pour ping
|
## Limite l'envoi à 3 requêtes pour ping
|
||||||
alias ping="ping -c 3"
|
alias ping="ping -c 3"
|
||||||
|
@ -1317,7 +1317,7 @@ function ippriv()
|
||||||
# Get main private IP adress {{{
|
# Get main private IP adress {{{
|
||||||
function ipmain()
|
function ipmain()
|
||||||
{
|
{
|
||||||
hostname -i
|
ip route get 1 | awk '{print $(NF-2);exit}'
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue