From da025c6349ba299d29cd79c0fcd4c907bc5be355 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 16 Apr 2012 12:35:51 +0000 Subject: Michael Proko: 30414: more flexible configuration file finding for _mdadm --- Completion/Linux/Command/_mdadm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Completion/Linux') diff --git a/Completion/Linux/Command/_mdadm b/Completion/Linux/Command/_mdadm index 461e66617..940eb6887 100644 --- a/Completion/Linux/Command/_mdadm +++ b/Completion/Linux/Command/_mdadm @@ -147,7 +147,15 @@ fi _mds () { local -a vals - vals=( ${${${(M)${(f)"$(< /etc/mdadm.conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) + if [ -r /etc/mdadm.conf ] ; then + local mdadm_conf=/etc/mdadm.conf + elif [ -r /etc/mdadm/mdadm.conf ] ; then + local mdadm_conf=/etc/mdadm/mdadm.conf + else + _message "could not find mdadm.conf" + return 1 + fi + vals=( ${${${(M)${(f)"$(< $mdadm_conf)"}##ARRAY *}//ARRAY /}%%[[:blank:]]*} ) _describe -t mds "RAID devices" vals _arguments \ "(-h --help)"{-h,--help}'[display a mode specific help message]' -- cgit 1.4.1