From 2f2dbf5306f87c082620613d069a2068bf350ad3 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 23 Jul 2015 06:41:53 +0000 Subject: Added bash completion after sudo --- bash/.bashrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index 153f4e2..5e0625b 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -41,6 +41,10 @@ exists() { hash $@ 2> /dev/null } +if exists complete && exists sudo; then + complete -cf sudo +fi + if exists mpv; then alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' elif exists vlc; then @@ -71,13 +75,13 @@ if exists gem; then export PATH="$PATH:$GEM_HOME" fi -if exists ezjail-admin; then +if exists ezjail-admin && exists sudo; then jl() { sudo ezjail-admin $1 $2\.tomvanderlee.com } fi -if exists pfctl; then +if exists pfctl && exists sudo; then showbanned () { for table in "fail2ban" "permaban"; do @@ -87,7 +91,7 @@ if exists pfctl; then } fi -if exists pacman && ! exists pacaur; then +if (exists pacman && !exists pacaur) && exists sudo; then alias pacaur="sudo pacman" fi -- cgit v1.2.3