-
Notifications
You must be signed in to change notification settings - Fork 0
/
web_install.sh
37 lines (28 loc) · 1.02 KB
/
web_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
#!/bin/bash
CDIR=$(pwd)
REPO="https://raw.githubusercontent.com/Slyke/BashStyle"
touch ~/.bashrc
mkdir -p ~/.bashstyle
cd ~/.bashstyle
if grep -qF ". ~/.bashstyle/bashrc_inject" ~/.bashrc; then
rm bashrc_inject.sh 2>/dev/null
rm colors.conf 2>/dev/null
rm reinstall.sh 2>/dev/null
wget -q -O bashrc_inject.sh "$REPO/master/bashrc_inject.sh"
wget -q -O colors.conf "$REPO/master/colors.conf"
wget -q -O reinstall.sh "$REPO/master/web_install.sh"
echo "BashStyle is already installed in '~/.bashrc'. Replaced source files in '~/.bashstyle/'"
else
rm bashrc_inject.sh 2>/dev/null
rm colors.conf 2>/dev/null
rm reinstall.sh 2>/dev/null
wget -q -O bashrc_inject.sh "$REPO/master/bashrc_inject.sh"
wget -q -O colors.conf "$REPO/master/colors.conf"
wget -q -O reinstall.sh "$REPO/master/web_install.sh"
echo 'if [ -f ~/.bashstyle/bashrc_inject.sh ]; then' >> ~/.bashrc
echo ' . ~/.bashstyle/bashrc_inject.sh' >> ~/.bashrc
echo 'fi' >> ~/.bashrc
echo "BashStyle installed."
fi
source ~/.bashrc
cd $CDIR