-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·63 lines (50 loc) · 1.21 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
57
58
59
60
61
62
#!/bin/zsh
echo "Welcome my Michelle!"
echo
R=$HOME/.michelle
echo "destination: $R"
mkdir -p $R/log
mkdir -p $R/cache
mkdir -p $R/services/available
mkdir -p $R/services/enabled
mkdir -p $R/env.d
echo
echo "install service supervisor"
./bin/esh -o $R/supervisor.conf etc/supervisor.conf dest=$R user="$USER"
echo -n "install services... "
cp env.d/*.sh $R/env.d/
for i in `find ./services -name '*.conf'`; do
b=`basename $i`
if [ -r $R/services/available/$b ]; then continue; fi
./bin/esh -o $R/services/available/$b $i dest=$R user="$USER" home="$HOME"
echo -n "$b "
# activate by hand creating symlinks
ln -s $R/services/available/$b $R/services/enabled/$b
done
echo
echo "install oh-my-zsh"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "install the shell init"
./bin/esh -o $R/init.sh etc/init.sh dest=$R
function addshell() {
if [ -r $HOME/$1 ]; then
grep 'Michelle' $HOME/$1 >/dev/null
if [ $? != 0 ]; then
cat << EOF >> $HOME/$1
# added by Michelle
. $R/init.sh
EOF
echo -n "$1"
fi
echo
else
cat << EOF >> $HOME/$1
# added by Michelle
. $R/init.sh
EOF
fi
}
addshell .bashrc
addshell .zshrc
echo "Michelle is ready!"
# optional installation of packages if root