-
Notifications
You must be signed in to change notification settings - Fork 41
/
install_bashrc
executable file
·41 lines (34 loc) · 1.03 KB
/
install_bashrc
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
#!/bin/bash
# Install script for .bashrc settings
INSTALL_DIR="$HOME/.bash"
if [ -d $INSTALL_DIR ]; then
echo "Looks like you have a $INSTALL_DIR directory installed. Good job!"
exit
fi;
git clone https://github.com/cep21/jackbash.git $INSTALL_DIR
for x in $HOME/.bashrc $HOME/.profile $HOME/.bash_profile ; do
if [ -e $x ]; then
mv $x "$x"_backup
fi;
echo "source $INSTALL_DIR/bashrc" > $x
done
if [ ! -e $HOME/.gitconfig ]; then
# Copy because you have to fill in your user name
cp $INSTALL_DIR/config/.gitconfig $HOME/.gitconfig
fi;
if [ -e $HOME/.screenrc ]; then
mv $HOME/.screenrc $HOME/.screenrc_backup
fi;
ln -s $INSTALL_DIR/config/.screenrc $HOME/.screenrc
if [ -e $HOME/.inputrc ]; then
mv $HOME/.inputrc $HOME/.inputrc_backup
fi;
ln -s $INSTALL_DIR/config/.inputrc $HOME/.inputrc
if [ ! -e $HOME/.gitidentity ]; then
echo "Setting up your git identity in ~/.gitidentity:"
echo -n "Email: "
read email
echo -n "Name: "
read name
echo -e "[user]\n\tname = $name\n\temail = $email" > $HOME/.gitidentity
fi