File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
PATH=" $( pwd) "
4
4
INSTALLATION=" /etc/httpd/commands"
5
- PROFILE_PATH =" /etc/profile.d "
5
+ COMPLETIONS_PATH =" /usr/share/bash-completion/completions "
6
6
7
7
binPath=" /usr/bin"
8
8
verbose=
9
9
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 " " $@ "
15
11
16
12
while [ $# -gt 0 ] ; do
17
13
case $1 in
@@ -21,7 +17,6 @@ while [ $# -gt 0 ] ; do
21
17
shift
22
18
done
23
19
24
-
25
20
function _create_folder {
26
21
/bin/mkdir $INSTALLATION
27
22
@@ -48,10 +43,8 @@ function _install_commands {
48
43
function _set_autocomplete {
49
44
for file in $( /bin/ls -1 " $PATH /profile/" ) ; do
50
45
/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 "
52
47
done
53
-
54
- # source /etc/profile
55
48
}
56
49
57
50
if [ ! -d $INSTALLATION ]; then
You can’t perform that action at this time.
0 commit comments