Add eth-ip function

This commit is contained in:
crater2150 2017-03-06 17:14:54 +01:00
parent ad7a068e78
commit c5211a17f1
2 changed files with 6 additions and 2 deletions
aliases
modules/bindings

View file

@ -312,6 +312,10 @@ urlencode() {
#}}} #}}}
eth-ip() {
ip a show primary dev ${1:-/sys/class/net/en*~*/lo(:t)} | awk '/\s*inet / { split($2,a,"/");print a[1] }'
}
fasel-tunnel() { fasel-tunnel() {
if [[ -z "$1" || -z "$2" || "$1" == "-h" || "$1" == "--help" ]]; then if [[ -z "$1" || -z "$2" || "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: fasel-tunnel <host> <port> [remote_port]" echo "Usage: fasel-tunnel <host> <port> [remote_port]"

View file

@ -51,10 +51,10 @@ bindkey -s "^F" "fuck\n"
# Finally, make sure the terminal is in application mode, when zle is # Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid. # active. Only then are the values from $terminfo valid.
function zle-line-init () { local function zle-line-init () {
echoti smkx echoti smkx
} }
function zle-line-finish () { local function zle-line-finish () {
echoti rmkx echoti rmkx
} }
zle -N zle-line-init zle -N zle-line-init