-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·26 lines (22 loc) · 1 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#be sure to call this script from where its located, ie do "./install.sh" do not "../install.sh"
profile_file=".bashrc"
initial_pwd=`pwd`
[ -e ~/.bash_profile ] && mv ~/.bash_profile ~/.old_bash_profile|echo "backing up existing .bash_profile to .old_bash_profile..."
cd ${initial_pwd}
cp ./bash_profile ~/.bash_profile
cd ${HOME}
if ! [ -e ${profile_file} ]
then
touch ${profile_file} |echo "${profile_file} does not exist, creating..."
fi
if ! grep -q 'source ~/.bash_profile' "${profile_file}" ; then
echo "Adding 'source ~/.bash_profile' to ${profile_file}"
echo "source ~/.bash_profile" >> "${profile_file}"
fi
cd ${initial_pwd}
# If ~./inputrc doesnt exist yet, first include the original /etc/inputrc so we dont override it
if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi
# Add option to ~/.inputrc to enable case-insensitive tab completion
echo 'set completion-ignore-case On' >> ~/.inputrc
echo "logout and back in to complete setup (or '$ source ~/.bashrc')"