-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall
executable file
·86 lines (68 loc) · 2.55 KB
/
install
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
#!/bin/sh
##
# This script is to install Mateix
##
ROOTDOTFILE="/etc/.mateix"
BINFILE="/usr/bin"
SERVICEFILE="/etc/systemd/system"
## Colours
RED='\033[0;31m'
BLUE='\033[0;34m'
GREEN='\033[0;32m'
YELLOW="\033[1;33m"
NC='\033[0m'
echo $YELLOW
cat << "EOF"
---------------------------------------------------------------
___ ___ __ ___________ _______ __ ___ ___
|" \ /" | /""\(" _ ")/" "| |" \ |" \/" |
\ \ // | / \)__/ \\__/(: ______) || | \ \ /
/\\ \/. | /' /\ \ \\_ / \/ | |: | \\ \/
|: \. | // __' \ |. | // ___)_ |. | /\. \
|. \ /: | / / \\ \\: | (: "| /\ |\ / \ \
|___|\__/|___|(___/ \___)\__| \_______)(__\_|_)|___/\___|
---------------------------------------------------------------
EOF
echo ${NC}
echo "
This will install the Mateix tool in your system. This require
the root acess. Following are the tasks preformed.
${GREEN}[Task 1]${NC} Install all the dependencies.
${GREEN}[Task 2]${NC} Install the Mateix executables and services.
${GREEN}[Task 3]${NC} Create the dotfiles and config files.
"
echo "${YELLOW}---------------------------------------------------------------${NC}"
echo "\n${GREEN}- Executing Task 1${NC}\n"
sudo apt-get -y install inotify-tools
echo "\n${GREEN}✔ Task 1 Complete!${NC}\n"
echo "\n${GREEN}- Executing Task 2${NC}\n"
if [ ! -f "${BINFILE}/mateix" ];
then
sudo wget -O "${BINFILE}/mateix" https://github.com/ramantehlan/mateix/raw/master/mateix
sudo chmod +x "${BINFILE}/mateix"
fi
if [ ! -f "${BINFILE}/mateixWatch" ];
then
sudo wget -O "${BINFILE}/mateixWatch" https://raw.githubusercontent.com/ramantehlan/mateix/master/service/mateixWatch
sudo chmod +x "${BINFILE}/mateixWatch"
fi
if [ ! -f "${SERVICEFILE}/mateix-watch.service" ];
then
sudo wget -O "${SERVICEFILE}/mateix-watch.service" https://raw.githubusercontent.com/ramantehlan/mateix/master/service/mateix-watch.service
sudo chmod +rw "${SERVICEFILE}/mateix-watch.service"
sudo systemctl daemon-reload
sudo systemctl enable mateix-watch.service
fi
echo "'${BINFILE}/mateix' created"
echo "'${BINFILE}/mateixWatch' created"
echo "'${SERVICEFILE}/mateix-watch.service' created"
echo "\n${GREEN}✔ Task 2 Complete!${NC}\n"
echo "\n${GREEN}- Executing Task 3${NC}\n"
if [ ! -d $ROOTDOTFILE ];
then
sudo mkdir $ROOTDOTFILE
sudo touch "${ROOTDOTFILE}/syncList"
fi
echo "'${ROOTDOTFILE}' created"
echo "'${ROOTDOTFILE}/syncList' created"
printf "\n${GREEN}✔ Task 3 Complete!${NC}\n"