diff --git a/zshrc b/zshrc index fd5f9c6..d2ed76b 100644 --- a/zshrc +++ b/zshrc @@ -336,9 +336,9 @@ alias rd='rmdir' #Internet ## Minimal webserver from current directory and available at http://IP.AD.RE.SS:8002 ## 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 -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 alias ping="ping -c 3" @@ -1317,7 +1317,7 @@ function ippriv() # Get main private IP adress {{{ function ipmain() { - hostname -i + ip route get 1 | awk '{print $(NF-2);exit}' } # }}}