aboutsummaryrefslogtreecommitdiffstats
path: root/templates/diddle/root_clone.sh
blob: a3dbdac3bf9780022989290d9ba60034e732c93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# Exits with 100 if the directory was changed

if [ ! -f /root/diddle ]; then
    git clone https://github.com/jantuomi/diddle.git /root/diddle && exit 100
fi

cd /root/diddle
before=$(git rev-parse HEAD)
git fetch && git pull --ff-only --quiet
after=$(git rev-parse HEAD)

if [ "$before" != "$after" ]; then exit 100; fi