summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSteven Hiscocks <steven@hiscocks.me.uk>2013-05-06 20:37:58 +0100
committerSteven Hiscocks <steven@hiscocks.me.uk>2013-05-06 20:37:58 +0100
commit95726b3976500b3d51d74ea24f0cb4640c79aaed (patch)
treedef7ca3625bdc88fe8c59c4749ebd2f58a4bba09 /files
parent92dff6d645b26ce35c09689e654c2a4c6fb656c9 (diff)
downloadfail2ban-95726b3976500b3d51d74ea24f0cb4640c79aaed.tar.gz
DOC: Drop sudo from bash-completion
Diffstat (limited to 'files')
-rw-r--r--files/bash-completion11
1 files changed, 4 insertions, 7 deletions
diff --git a/files/bash-completion b/files/bash-completion
index 25ccbc30..7a42bd1e 100644
--- a/files/bash-completion
+++ b/files/bash-completion
@@ -16,11 +16,8 @@
# along with Fail2Ban; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-__sudo () {
- sudo -n "$@" 2>/dev/null || return 0
-}
__fail2ban_jails () {
- __sudo "$1" status | awk -F"\t+" '/Jail list/{print $2}' | sed 's/, / /g'
+ "$1" status 2>/dev/null | awk -F"\t+" '/Jail list/{print $2}' | sed 's/, / /g'
}
_fail2ban () {
@@ -117,7 +114,7 @@ _fail2ban () {
;;
dellogpath|delignoreip)
COMPREPLY=( $( compgen -W \
- "$( __sudo "$1" get "$jail" "${prev/del/}" | awk -F- '{print $2}')" \
+ "$( "$1" get "$jail" "${prev/del/}" 2>/dev/null | awk -F- '{print $2}')" \
-- "$cur" ) )
if [[ -z "$COMPREPLY" && "$prev" == "dellogpath" ]];then
_filedir
@@ -126,13 +123,13 @@ _fail2ban () {
;;
delfailregex|delignoregex)
COMPREPLY=( $( compgen -W \
- "$( __sudo "$1" get "$jail" "${prev/del/}" | awk -F"[][]" '{print $2}')" \
+ "$( "$1" get "$jail" "${prev/del/}" 2>/dev/null | awk -F"[][]" '{print $2}')" \
-- "$cur" ) )
return 0
;;
unbanip)
COMPREPLY=( $( compgen -W \
- "$( __sudo "$1" status "$jail" | awk -F"\t+" '/IP list:/{print $2}')" \
+ "$( "$1" status "$jail" 2>/dev/null | awk -F"\t+" '/IP list:/{print $2}')" \
-- "$cur" ) )
return 0
;;