install improvements
- Better stats for updates. - Option to skip stats for custom versions. - Now we can update from an specific branch.
This commit is contained in:
parent
b8e7b6be10
commit
aea7852733
|
@ -3,7 +3,7 @@ source /opt/webinoly/lib/general
|
||||||
|
|
||||||
|
|
||||||
app_version() {
|
app_version() {
|
||||||
local app_ver="1.5.1"
|
local app_ver="1.6.0-beta"
|
||||||
echo $app_ver
|
echo $app_ver
|
||||||
}
|
}
|
||||||
svr_version() {
|
svr_version() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ opt="$1"
|
||||||
source /opt/webinoly/lib/webin
|
source /opt/webinoly/lib/webin
|
||||||
|
|
||||||
# Extract value if exist
|
# Extract value if exist
|
||||||
if [[ $opt == "-tools-port="* || $opt == "-config-cache="* || $opt == "-clear-cache="* || $opt == "-server-update="* || $opt == "-server-reset="* || $opt == "-timezone="* ]]; then
|
if [[ $opt == "-tools-port="* || $opt == "-config-cache="* || $opt == "-clear-cache="* || $opt == "-server-update="* || $opt == "-server-reset="* || $opt == "-timezone="* || $opt == "-update="* ]]; then
|
||||||
value=$(echo "${opt}" | cut -d'=' -f 2 -s)
|
value=$(echo "${opt}" | cut -d'=' -f 2 -s)
|
||||||
opt=$(echo "${opt}" | cut -d'=' -f 1 -s)
|
opt=$(echo "${opt}" | cut -d'=' -f 1 -s)
|
||||||
fi
|
fi
|
||||||
|
@ -17,7 +17,8 @@ fi
|
||||||
|
|
||||||
if [[ $opt == "-update" ]]; then
|
if [[ $opt == "-update" ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
sudo wget --timeout=15 --referer="https://update.webinoly.com/?ver=$(app_version)" -qrO weby https://qrok.es/wyupd && sudo bash weby 0
|
[[ -n $value ]] && branch="-ver=${value}" || branch=""
|
||||||
|
sudo wget --timeout=15 --referer="https://update.webinoly.com/?ver=$(app_version)" -qrO weby https://qrok.es/wyupd && sudo bash weby upd $branch
|
||||||
echo "${gre}Webinoly App has been updated successfully!${end}"
|
echo "${gre}Webinoly App has been updated successfully!${end}"
|
||||||
|
|
||||||
|
|
||||||
|
|
23
weby
23
weby
|
@ -14,10 +14,16 @@ if ! [[ $distr == "Ubuntu" && $osver =~ ^(xenial|bionic)$ ]]; then
|
||||||
read -p "Press [Enter] key to continue..."
|
read -p "Press [Enter] key to continue..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# In case client is just Updating Webinoly and not fresh-installing we need accurate statistics.
|
||||||
|
[[ -n "$1" ]] && setup="$1" || setup=9
|
||||||
|
if [[ $setup == "upd" ]]; then
|
||||||
|
setup=0
|
||||||
|
update="&update=true"
|
||||||
|
else
|
||||||
|
update=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Diplay menu to select type of server
|
# Diplay menu to select type of server
|
||||||
[[ -n "$1" ]] && setup="$1" || setup=9
|
|
||||||
|
|
||||||
while ! [[ $setup -ge 0 && $setup -le 3 && $setup =~ ^[0-9]+$ ]] 2>/dev/null
|
while ! [[ $setup -ge 0 && $setup -le 3 && $setup =~ ^[0-9]+$ ]] 2>/dev/null
|
||||||
do
|
do
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -35,7 +41,14 @@ done
|
||||||
|
|
||||||
# Download and install Webinoly
|
# Download and install Webinoly
|
||||||
if [[ $2 == "-ver="* ]]; then
|
if [[ $2 == "-ver="* ]]; then
|
||||||
ver=$(echo "$2" | cut -d'=' -f 2 -s)
|
ver=$(echo "$2" | cut -d'=' -f 2 -s)
|
||||||
|
|
||||||
|
# Skip stadistics counters for dev and testing (custom version stats).
|
||||||
|
if [[ $(echo "${ver}" | rev | cut -c-1) == "*" || $ver == "alpha" ]]; then
|
||||||
|
ver=${ver//'*'}
|
||||||
|
statskip="true"
|
||||||
|
fi
|
||||||
|
|
||||||
# Be sure we have a valid server response for the requested version
|
# Be sure we have a valid server response for the requested version
|
||||||
code=$(wget --server-response --spider https://qrok.es/webinoly?version=$ver 2>&1 | awk '/^ HTTP/{print $2}')
|
code=$(wget --server-response --spider https://qrok.es/webinoly?version=$ver 2>&1 | awk '/^ HTTP/{print $2}')
|
||||||
# Get the last code (redirections)
|
# Get the last code (redirections)
|
||||||
|
@ -47,14 +60,14 @@ if [[ $2 == "-ver="* ]]; then
|
||||||
webyversion="$ver"
|
webyversion="$ver"
|
||||||
[[ $ver == "beta" ]] && echo "[WARNING] You are installing a BETA version of Webinoly and it's not recommended for production enviroments."
|
[[ $ver == "beta" ]] && echo "[WARNING] You are installing a BETA version of Webinoly and it's not recommended for production enviroments."
|
||||||
# Just for stadistics
|
# Just for stadistics
|
||||||
[[ $ver != "alpha" ]] && sudo wget --timeout=15 --spider --referer="https://webinoly.com/?version=${ver}" -q https://qrok.es/wyver
|
[[ $statskip == "true" ]] || sudo wget --timeout=15 --spider --referer="https://webinoly.com/?version=${ver}${update}" -q https://qrok.es/wyver
|
||||||
else
|
else
|
||||||
echo "[ERROR] Version not found or not available! ($code) $(tput sgr0)"
|
echo "[ERROR] Version not found or not available! ($code) $(tput sgr0)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo $(tput sgr0)
|
echo $(tput sgr0)
|
||||||
else
|
else
|
||||||
sudo wget --timeout=15 --referer="https://webinoly.com/?option=${setup}" -qrO $HOME/webinoly.tar https://qrok.es/wytar
|
sudo wget --timeout=15 --referer="https://webinoly.com/?option=${setup}${update}" -qrO $HOME/webinoly.tar https://qrok.es/wytar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ ! -d /opt/webinoly ]] && sudo mkdir /opt/webinoly
|
[[ ! -d /opt/webinoly ]] && sudo mkdir /opt/webinoly
|
||||||
|
|
Loading…
Reference in a new issue