This commit is contained in:
kjeld Schouten-Lebbing 2020-05-24 23:00:59 +02:00
parent 29c0e13eb7
commit 9483212dba
2 changed files with 5 additions and 4 deletions

View File

@ -24,10 +24,11 @@ parse_yaml() {
# automatic update function # automatic update function
gitupdate() { gitupdate() {
git remote add upstream https://github.com/jailmanager/jailman.git > /dev/null 2>&1
echo "checking for updates using Branch: $1" echo "checking for updates using Branch: $1"
git fetch git fetch upstream
git update-index -q --refresh git update-index -q --refresh
CHANGED=$(git diff --name-only origin/"$1") CHANGED=$(git diff --name-only "$1")
if [ -n "$CHANGED" ]; if [ -n "$CHANGED" ];
then then
echo "script requires update" echo "script requires update"

View File

@ -20,13 +20,13 @@ if ! [ "$(id -u)" = 0 ]; then
fi fi
# Auto Update # Auto Update
BRANCH="master" BRANCH="upstream/master"
gitupdate ${BRANCH} gitupdate ${BRANCH}
# If no option is given, point to the help menu # If no option is given, point to the help menu
if [ $# -eq 0 ] if [ $# -eq 0 ]
then then
echo "Missing options!" echo "Missing options!"
echo "(run $0 -h for help)" echo "(run $0 -h for help)"
echo "" echo ""
exit 0 exit 0