-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·60 lines (43 loc) · 1.16 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
#!/bin/sh
#
# Crude installation script for motionCenter.
#
# This script exists because it is much easier than making a .deb or .rpm,
# and it should work on most Linux installations.
#
# Create the directories.
INSTALLPATH=$1
if [ $# -lt 1 ] ; then
INSTALLPATH=/storage/motion
fi
if [ ! -d $INSTALLPATH ] ; then
echo "creating $INSTALLPATH"
mkdir -p $INSTALLPATH
fi
for dir in public scripts videos config ; do
mkdir -p $INSTALLPATH/$dir
done
# Install the software itself.
for dir in public scripts ; do
cp -uv $dir/* $INSTALLPATH/$dir
done
for file in config/*.rc ; do
if [ ! -e $INSTALLPATH/$file ] ; then
cp -v $file $INSTALLPATH/config
fi
done
# Set proper ownership for all these files.
for dir in public scripts videos config ; do
chown -R motion:motion $INSTALLPATH/$dir
done
# Install the tclHttpd default's configuration.
SYSCONFIG=/etc/default/tclhttpd
if [ ! -e $SYSCONFIG ] ; then
cp -uv $INSTALLPATH/config/tclhttpd.rc $SYSCONFIG
fi
# Install the SYS V style init script.
if [ ! -e /etc/init.d/tclhttpd ] ; then
cp -uv sysv/tclhttpd.init /etc/init.d
chown root:root /etc/init.d/tclhttpd
chmod 755 /etc/init.d/tclhttpd
fi