Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update edge.sh #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions edge.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
#!/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 /tmp/edge_installed ]]; then
echo "Updating source..."
cd /opt/${APP}
git pull
else
apt-get install -qy git
rm -rf /opt/couchpotato
git clone https://github.com/RuudBurger/CouchPotatoServer.git /opt/couchpotato
chown -R nobody:users /opt/couchpotato
apt-get install -qy git >/dev/null
echo "Downloading source..."
tmpdir="/tmp/tmp.$(( $RANDOM * $RANDOM * $RANDOM * $RANDOM ))"
git clone ${REPO} $tmpdir
if [[ $? -eq 0 ]]; then
rm -rf /opt/${APP}
mv $tmpdir /opt/${APP}
touch /tmp/edge_installed
else
rm -rf $tmpdir
fi
fi

# Fix permissions
chown -R nobody:users /opt/${APP}