diff options
author | Igor Murzov <e-mail@date.by> | 2011-11-07 02:45:33 +0300 |
---|---|---|
committer | Igor Murzov <e-mail@date.by> | 2011-11-07 02:53:25 +0300 |
commit | b03435fcc2e8a1f3ea2f72878e202f3a56bfc8de (patch) | |
tree | 9443e4b9bc0e22635c098ef83d382ef16c3e3ba5 /bash_completion | |
parent | 01477d9c9e43c04bb33e59b7c62f938ba172a33b (diff) | |
download | bash-completion-service.tar.gz |
Add and use _sysvdirs() function that sets correct SysV init directory.service
This function allows distros to fine tune their init directory location,
as simple checking for directories presence is not always sufficient.
Diffstat (limited to 'bash_completion')
-rw-r--r-- | bash_completion | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bash_completion b/bash_completion index 6d3ffe2f..d96a7770 100644 --- a/bash_completion +++ b/bash_completion @@ -106,6 +106,17 @@ _userland() [[ $userland == $1 ]] } +# This function sets correct SysV init directory +# +_sysvdirs() +{ + sysvdirs=( ) + [[ -d /etc/rc.d/init.d ]] && sysvdirs+=( /etc/rc.d/init.d ) + [[ -d /etc/init.d ]] && sysvdirs+=( /etc/init.d ) + # Slackware uses /etc/rc.d + [[ -f /etc/slackware-version ]] && sysvdirs=( /etc/rc.d ) +} + # This function checks whether we have a given program on the system. # _have() |