Skip to content

Commit 76e99cd

Browse files
committed
add autocompletions in bash completion folder
1 parent 14ba727 commit 76e99cd

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

install.sh

+3-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22

33
PATH="$(pwd)"
44
INSTALLATION="/etc/httpd/commands"
5-
PROFILE_PATH="/etc/profile.d"
5+
COMPLETIONS_PATH="/usr/share/bash-completion/completions"
66

77
binPath="/usr/bin"
88
verbose=
99

10-
if [[ $EUID -ne 0 ]]; then
11-
echo "This script must be run as root"
12-
exit 1
13-
fi
14-
10+
[ "$(/bin/whoami)" != "root" ] && exec /bin/sudo -- "$0" "$@"
1511

1612
while [ $# -gt 0 ] ; do
1713
case $1 in
@@ -21,7 +17,6 @@ while [ $# -gt 0 ] ; do
2117
shift
2218
done
2319

24-
2520
function _create_folder {
2621
/bin/mkdir $INSTALLATION
2722

@@ -48,10 +43,8 @@ function _install_commands {
4843
function _set_autocomplete {
4944
for file in $(/bin/ls -1 "$PATH/profile/"); do
5045
/bin/chmod $verbose +x "$PATH/profile/$file"
51-
/bin/cp $verbose +x "$PATH/profile/$file" "$PROFILE_PATH"
46+
/bin/cp $verbose "$PATH/profile/$file" "$COMPLETIONS_PATH/$file"
5247
done
53-
54-
# source /etc/profile
5548
}
5649

5750
if [ ! -d $INSTALLATION ]; then

0 commit comments

Comments
 (0)