1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-12 11:21:55 +00:00

Update build script

This commit is contained in:
Ycarus 2018-07-18 22:36:20 +02:00
parent 08bcec0377
commit 27b5c3853a

View file

@ -5,13 +5,19 @@ set -e
umask 0022
unset GREP_OPTIONS SED
_get_repo() {
git clone "$2" "$1" 2>/dev/null || true
git -C "$1" remote set-url origin "$2"
git -C "$1" fetch origin
git -C "$1" fetch origin --tags
git -C "$1" checkout "origin/$3" -B "build" || git -C "$1" checkout "$3" -B "build"
}
_get_repo() (
mkdir -p "$1"
cd "$1"
[ -d .git ] || git init
if git remote get-url origin >/dev/null 2>/dev/null; then
git remote set-url origin "$2"
else
git remote add origin "$2"
fi
git fetch origin
git fetch origin --tags
git checkout "origin/$3" -B "build" 2>/dev/null || git checkout "$3" -B "build"
)
OMR_DIST=${OMR_DIST:-openmptcprouter}
OMR_HOST=${OMR_HOST:-$(curl -sS ifconfig.co)}