Files
WPIQ/wo.sh

48 lines
1.4 KiB
Bash
Raw Normal View History

2019-04-10 16:09:25 +02:00
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# WordOps install script downloader
# -------------------------------------------------------------------------
# Website: https://wordops.net
# GitHub: https://github.com/WordOps/WordOps
# Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T
# -------------------------------------------------------------------------
# Version 3.9.5 - 2019-04-10
# -------------------------------------------------------------------------
###
# 1 - Check whether the installation is called with elevated rights
###
if [[ $EUID -ne 0 ]]; then
wo_lib_echo_fail "Sudo privilege required..."
wo_lib_echo_fail "Use: wget -qO wo wops.cc && sudo bash wo"
exit 100
fi
2019-04-10 21:18:09 +02:00
# check if git is installed
2019-04-10 16:09:25 +02:00
[ -z "$(command -v git)" ] && {
apt-get update -qq && apt-get install git -qq
} > /dev/null 2>&1
2019-04-10 21:18:09 +02:00
# set github repository branch
if [ -n "$1" ]; then
wo_branch="$1"
2019-04-10 17:18:24 +02:00
else
2019-04-10 21:18:09 +02:00
wo_branch=master
2019-04-10 17:18:24 +02:00
fi
2019-04-10 16:09:25 +02:00
# update or clone wordops repositoru
if [ -d /tmp/WordOps/.git ]; then
2019-04-10 21:18:09 +02:00
git -C /tmp/WordOps fetch --all
git -C /tmp/WordOps reset --hard origin/${wo_branch}
git -C /tmp/WordOps clean -f
2019-04-10 16:09:25 +02:00
else
rm -rf /tmp/WordOps
2019-04-10 17:18:24 +02:00
git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$wo_branch" -q
2019-04-10 16:09:25 +02:00
fi
2019-04-10 21:18:09 +02:00
# execute install script
2019-04-10 16:09:25 +02:00
if [ -x /tmp/WordOps/install ]; then
2019-04-10 21:18:09 +02:00
/tmp/WordOps/install
2019-04-10 16:09:25 +02:00
fi