X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=bashrc;h=d84d7c960aac24bc6411060259ed312ea30aed37;hp=3e6cc3aa644f0dc7f9c2937ed7e8ec261d5349c7;hb=57b8176460224fc44e6b83bdb305604063c8eed8;hpb=856983cd510a04e27d441990c73f04e4b47e162f diff --git a/bashrc b/bashrc index 3e6cc3a..d84d7c9 100644 --- a/bashrc +++ b/bashrc @@ -170,8 +170,8 @@ function ua () { case "$1" in - *.tgz|*.tar.gz) - tar zxvf "$1" + *.tgz|*.tar.gz|*.tbz|*.tar.bz2) + tar xvf "$1" ;; *.rar) @@ -339,19 +339,26 @@ function dt () { [[ ${NETUP_HISTORY} ]] || NETUP_HISTORY="${HOME}/.netup_history" function netup () { - if [[ $(ps auxwww | grep dhclient | grep -v grep) ]]; then + if [[ $(\ifconfig -s | grep -v ^"(Iface|lo) ") ]]; then + echo "There is already interface(s) up." >&2 + return 1 + fi + + if [[ $(\ps -C dhclient | tail -n +2) ]]; then echo "There is already a dhcp client running." >&2 return 1 fi - if [[ $(ps auxwww | grep wpa_supplicant | grep -v grep) ]]; then + if [[ $(\ps -C wpa_supplicant | tail -n +2) ]]; then echo "There is already a wpa_supplicant running." >&2 return 1 fi if [[ ! "$@" ]] && [[ -s ${NETUP_HISTORY} ]]; then - # If we have no argument and there is a .netup_history, use it - ARGS=$(cat ${NETUP_HISTORY}) + echo "netup " >&2 + return 1 + # # If we have no argument and there is a .netup_history, use it + # ARGS=$(cat ${NETUP_HISTORY}) else # Otherwise uses the given arguments, and store them ARGS="$@"