-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·42 lines (36 loc) · 967 Bytes
/
install.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# mybash install script
# author: Helder Vasconcelos
install_dir=$HOME/.mybash
install_log_file=$install_dir/mybash_install.log
. installf.bash
first_time_install(){
version=`cat .git/refs/heads/master`
echo "Installing mybash on your system commit=[$version]"
mkdir -p $install_dir
bash_login_files="$HOME/.bash_profile
$HOME/.bash_login
$HOME/.profile"
mkdir -p $install_dir
cp -r * $install_dir/
cp -r .git $install_dir/
for bl in $bash_login_files; do
if [[ -e $bl ]]; then
mybash_install=$(cat $bl | grep -c ". \$HOME/.mybash/mybash.bash")
if [[ $mybash_install -eq 0 ]]; then
cat mybash_init_template >> $bl
fi
return 0
fi
done
cat .bash_profile_temp > ${bash_login_files[0]}
}
install_files(){
if [[ ! -e $install_dir ]]; then
first_time_install
else
echo "mybash already installed"
mybash_update
fi
}
install_files