last modification to install script
This commit is contained in:
15
wo.sh
15
wo.sh
@@ -19,24 +19,29 @@ if [[ $EUID -ne 0 ]]; then
|
||||
exit 100
|
||||
fi
|
||||
|
||||
# check if git is installed
|
||||
[ -z "$(command -v git)" ] && {
|
||||
apt-get update -qq && apt-get install git -qq
|
||||
} > /dev/null 2>&1
|
||||
|
||||
if [ "${#}" = "0" ]; then
|
||||
wo_branch=master
|
||||
# set github repository branch
|
||||
if [ -n "$1" ]; then
|
||||
wo_branch="$1"
|
||||
else
|
||||
wo_branch="$@"
|
||||
wo_branch=master
|
||||
fi
|
||||
|
||||
# update or clone wordops repositoru
|
||||
if [ -d /tmp/WordOps/.git ]; then
|
||||
git -C /tmp/WordOps pull origin master -q
|
||||
git -C /tmp/WordOps fetch --all
|
||||
git -C /tmp/WordOps reset --hard origin/${wo_branch}
|
||||
git -C /tmp/WordOps clean -f
|
||||
else
|
||||
rm -rf /tmp/WordOps
|
||||
git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$wo_branch" -q
|
||||
fi
|
||||
|
||||
# execute install script
|
||||
if [ -x /tmp/WordOps/install ]; then
|
||||
/tmp/WordOps/install "$wo_branch"
|
||||
/tmp/WordOps/install
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user