forked from icea-dev/ptracks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·40 lines (33 loc) · 949 Bytes
/
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
#!/bin/sh
INSTALL_DIR=/usr/local/lib/python2.7/dist-packages
PTRACKS=ptracks
echo "Adding ptracks to Python path (/usr/local/lib/python2.7/dist-packages)"
if [ -d $INSTALL_DIR/$PTRACKS ]; then
rm -f /usr/local/lib/python2.7/dist-packages/ptracks
fi
ln -s `pwd`/ptracks /usr/local/lib/python2.7/dist-packages/ptracks
#
# /etc/ptracks
#
echo "Creating /etc/ptracks directory"
if [ -d /etc/$PTRACKS ]; then
rm -rf /etc/ptracks
fi
sudo mkdir /etc/ptracks
ln -s `pwd`/data /etc/ptracks/data
ln -s `pwd`/tracks.cfg /etc/ptracks/tracks.cfg
ln -s `pwd`/public_html /etc/ptracks/public_html
#
# /etc/init.d/ptracks
#
echo "Creating /etc/init.d/ptracks script"
rm -rf /etc/init.d/ptracks
ln -s `pwd`/bin/ptracks-daemon /etc/init.d/ptracks
ln -s `pwd`/bin/ptracks-net /etc/init.d/ptracks-net
#
# System binaries
#
echo "Copying binaries to /usr/local/bin/ptracks"
rm -f /usr/local/bin/ptracks*
sudo cp bin/* /usr/local/bin
echo "Installation complete"