-
Notifications
You must be signed in to change notification settings - Fork 2
/
quick_setup
executable file
·36 lines (36 loc) · 1.31 KB
/
quick_setup
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
#!/bin/bash -x
#Use regular setup to install the code and most python dependencies.
python ./setup.py build
sudo python ./setup.py install
#The above seems to fail sometimes after updating a source file, running it twice seems to fix it, duno why yet
python ./setup.py build
sudo python ./setup.py install
#Create the mattockfs user and make it a member of the fuse group if needed
if grep --quiet "^mattockfs:" /etc/passwd; then
echo "User mattockfs exists already"
else
if grep --quiet "^fuse:" /etc/group; then
sudo useradd mattockfs -g fuse -d /var/mattock -m
sudo mkdir -p /var/mattock/archive
sudo mkdir -p /var/mattock/log
sudo mkdir -p /var/mattock/mnt
sudo chown -R mattockfs:fuse /var/mattock
else
sudo useradd mattockfs -d /var/mattock -m
sudo mkdir -p /var/mattock/archive
sudo mkdir -p /var/mattock/log
sudo mkdir -p /var/mattock/mnt
sudo chown -R mattockfs:mattockfs /var/mattock
fi
fi
#Patch fuse.conf to include user_allow_other
if grep --quiet "^user_allow_other" /etc/fuse.conf; then
echo "user_allow_other already set for fuse"
else
sudo sh -c '/bin/echo user_allow_other >> /etc/fuse.conf'
fi
#Copy the start, stop and test scripts to /usr/local/bin
sudo cp bin/* /usr/local/bin/
sudo cp mattockfs.json /etc/
sudo mkdir /etc/mattockfs.d
sudo touch /etc/mattockfs.d/test