-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyshell
executable file
·104 lines (82 loc) · 1.93 KB
/
myshell
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
if hash git 2>/dev/null; then
echo "Check Git Installed"
else
echo "Please Install Git"
exit
fi
FILE=~/.ssh/github
if [ -f $FILE ]; then
echo "File $FILE exists."
else
echo "File $FILE does not exist."
echo "Specify string you want to attach your ssh-keygen:"
read str
ssh-keygen -f ~/.ssh/github -C "$str"
# Add the following to .ssh/config
cat > ~/.ssh/config << EOL
Host github.com
Hostname github.com
IdentityFile ~/.ssh/github
EOL
echo "Paste the following to add ssh key in github settings:"
cat ~/.ssh/github.pub
fi
# Wait for ssh key added to github
echo "Did you complete adding ssh key to your github? (Y/N)"
read response
if (( "$response" == "Y" )); then
git clone [email protected]:tanyeun/dotfiles.git
else
echo "Please add ssh key in order to get configurations"
exit
fi
pushd ~/dotfiles
git config --global core.editor vi
git fetch
git branch -r
cat << EOF
Please select your environment:
1. centos
2. linux
3. linux_server
4. mac
5. windows 10 ubuntu bash
6. windows 10 ubuntu bash connect to linux
EOF
read option
case "$option" in
1) echo "Setting up environment for centos"
git checkout centos
;;
2) echo "Setting up environment for linux"
git checkout linux
;;
3) echo "Setting up environment for linux server"
git checkout linux_server
;;
4) echo "Setting up environment for mac"
git checkout master
;;
5) echo "Setting up environment for windows 10 ubuntu bash"
git checkout windows_ubash
cp .inputrc ~
cp .dircolors ~
cp .gitconfig ~
;;
6) echo "Setting up environment for windows 10 ubuntu bash connect to linux"
git checkout win_ubash2linux
cp .inputrc ~
cp .dircolors ~
cp .gitconfig ~
;;
esac
# Common settings
cp .bashrc ~
cp .bash_profile ~
cp .vimrc ~
cp -rf .vim ~
cp .tmux.conf ~
popd
source ~/.bashrc
tmux source-file ~/.tmux.conf