diff --git a/utils/lodspk.sh b/utils/lodspk.sh index 502b8125bcca0dcee2023e99c3369aaac731ccd4..c73af22cb006c1cfb8bca8e9264b2180d7d512c4 100755 --- a/utils/lodspk.sh +++ b/utils/lodspk.sh @@ -32,6 +32,8 @@ USAGE=$USAGE" Remove any variable:\t\t\t\t\t$0 remove variable\n" USAGE=$USAGE" If the variable is part of LODSPeaKr, it will return to its default value\n" USAGE=$USAGE" \n===ADMIN USER===\n" USAGE=$USAGE" Change password:\t\t\t\t\t$0 change password NEWPASSWORD\n" +USAGE=$USAGE" \n===UPDATE===\n" +USAGE=$USAGE" Update LODSPeaKr:\t\t\t\t\t$0 update\n" USAGE=$USAGE"\n===VERSION==\n" USAGE=$USAGE" Version:\t\t\t\t\t\t$0 version\n" USAGEDEBUG="Usage: $0 debug on|off" @@ -41,7 +43,7 @@ if [[ $# -eq 0 || "$1" == "--help" ]]; then fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -operations=( create delete debug backup restore default cache version enable disable add remove list details change ) +operations=( create delete debug backup restore default cache version enable disable add remove list details change update ) currentOperation= if [[ ${operations[@]} =~ $1 ]]; then @@ -325,3 +327,9 @@ if [[ $currentOperation == "change" ]]; then php $DIR/modules/change-password.php $3 exit fi + +## Update +if [[ $currentOperation == "update" ]]; then + $DIR/modules/update-lodspeakr.sh + exit +fi diff --git a/utils/modules/update-lodspeakr.sh b/utils/modules/update-lodspeakr.sh new file mode 100755 index 0000000000000000000000000000000000000000..de6e558593a831cdb8956613425269e5d3ec5dbe --- /dev/null +++ b/utils/modules/update-lodspeakr.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/../.. +GIT=`which git` +if [ -z $GIT ];then + echo "No git found. Aborting" + exit 1 +fi + +echo Updating LODSPeaKr +$GIT pull -q +if [ "$?" != 0 ];then + echo "Update couldn't finish properly. Stopping further actions" + exit 0 +fi + +echo Updating GUI elements +cp -rf doc/examples/originalComponents/static/admin/* components/static/admin/