forked from needo37/couchpotato
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedge.sh
More file actions
27 lines (25 loc) · 692 Bytes
/
edge.sh
File metadata and controls
27 lines (25 loc) · 692 Bytes
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
#!/bin/bash
APP="couchpotato"
REPO="https://github.com/RuudBurger/CouchPotatoServer.git"
INSTALLDIR="/opt/${APP}"
# Does the user want the latest version
if [ -z "$EDGE" ]; then
echo "Bleeding edge not requested."
elif [[ -f /var/lib/edge_installed ]]; then
echo "Updating source..."
mkdir -p ${INSTALLDIR} && cd ${INSTALLDIR}
git pull
else
echo "Downloading source..."
tmpdir="/tmp/tmp.$(( $RANDOM * $RANDOM * $RANDOM * $RANDOM ))"
git clone --depth=1 ${REPO} ${tmpdir}
if [[ $? -eq 0 ]]; then
rm -rf ${INSTALLDIR}
mv ${tmpdir} ${INSTALLDIR}
touch /var/lib/edge_installed
else
rm -rf ${tmpdir}
fi
fi
# Fix permissions
chown -R nobody:users ${INSTALLDIR}