-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstall.sh
executable file
·56 lines (46 loc) · 1.31 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
WD=`pwd`
REPO="git://github.com/robbyrussell/oh-my-zsh.git"
LOCAL_SETTINGS="$HOME/.local.zshrc"
SETTINGS="$HOME/.zshrc"
OK_FLAG=" [OK]"
ZSH_PATH=`which zsh`
# eventually check out oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo -n "need to clone oh-my-zsh repository from $REPO ... "
git clone $REPO $HOME/.oh-my-zsh
echo $OK_FLAG
fi
# delete existing .zshrc
if [ -f "$SETTINGS" ]; then
echo -n "deleting $SETTINGS ... "
rm $SETTINGS
echo $OK_FLAG
fi
# setting new symlink
echo -n "setting new symlink for .zshrc ... "
ln -s $WD/.zshrc $HOME/.zshrc
echo $OK_FLAG
# check for dependencies ...
# add an empty $HOME/.local.zshrc file
if [ ! -f "$LOCAL_SETTINGS" ]; then
echo -n "creating $HOME/.local.zshrc file for your local settings ... "
touch $HOME/.local.zshrc
echo $OK_FLAG
fi
# sym link for .screenrc file
if [ ! -f "$HOME/.screenrc" ]; then
echo -n "creating $HOME/.screenrc for screen settings ... "
ln -s $WD/.screenrc $HOME/.screenrc
echo $OK_FLAG
fi
# install ssh blacklisting tool
if [ ! -f "$HOME/bin/sshblack" ]; then
echo -n "setting new symlink for sshblack"
ln -s $WD/bin/sshblack $HOME/sshblack
echo $OK_FLAG
echo "running sshblack for the first time"
sudo $WD/bin/sshblack/sshblack.pl
fi
echo ""
echo " => now run 'chsh -s $ZSH_PATH' to change your used shell to activate settings"