install any version
Now we can install any version to ensure stability in projects. And some other minor improvements in installation script.
This commit is contained in:
parent
cef1fed914
commit
4cac1bf105
|
@ -18,12 +18,8 @@ fi
|
||||||
|
|
||||||
|
|
||||||
if [ "$opt" == "-update" ]; then
|
if [ "$opt" == "-update" ]; then
|
||||||
if [[ $arg == '-vbeta' ]]; then
|
|
||||||
sudo wget --timeout=15 -qrO weby https://qrok.es/wyupdb && sudo bash weby -vbeta
|
|
||||||
else
|
|
||||||
sudo wget --timeout=15 -qrO weby https://qrok.es/wyupd && sudo bash weby 0
|
|
||||||
fi
|
|
||||||
echo ""
|
echo ""
|
||||||
|
sudo wget --timeout=15 -qrO weby https://qrok.es/wyupd && sudo bash weby 0
|
||||||
echo "${gre}Webinoly App has been updated successfully!${end}"
|
echo "${gre}Webinoly App has been updated successfully!${end}"
|
||||||
elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
|
elif [[ "$opt" == "-server-update" || "$opt" == "-server-reset" ]]; then
|
||||||
|
|
||||||
|
|
38
weby
38
weby
|
@ -1,8 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Webinoly script.
|
# Webinoly Installation Script.
|
||||||
# This script is designed to install latest Webinoly.
|
webyversion="1.4.0-beta"
|
||||||
webyversion="1.3.1"
|
|
||||||
|
|
||||||
|
|
||||||
# Check OS support
|
# Check OS support
|
||||||
|
@ -21,7 +20,7 @@ fi
|
||||||
# Diplay menu to select type of server
|
# Diplay menu to select type of server
|
||||||
[[ -n "$1" ]] && setup="$1" || setup=9
|
[[ -n "$1" ]] && setup="$1" || setup=9
|
||||||
|
|
||||||
while ! [[ ($setup -ge 0 && $setup -le 4 && $setup =~ ^[0-9]+$) || $setup == '-vbeta' ]] 2>/dev/null
|
while ! [[ $setup -ge 0 && $setup -le 4 && $setup =~ ^[0-9]+$ ]] 2>/dev/null
|
||||||
do
|
do
|
||||||
echo ""
|
echo ""
|
||||||
echo " 1 - HTML Server"
|
echo " 1 - HTML Server"
|
||||||
|
@ -38,17 +37,27 @@ done
|
||||||
|
|
||||||
|
|
||||||
# Download and install Webinoly
|
# Download and install Webinoly
|
||||||
[[ ! -d /opt/webinoly ]] && sudo mkdir /opt/webinoly
|
if [[ $2 == "-ver="* ]]; then
|
||||||
|
ver=$(echo "$2" | cut -d'=' -f 2 -s)
|
||||||
|
# Be sure we have a valid server response for the requested version
|
||||||
|
code=$(wget --server-response https://qrok.es/webinoly?version=$ver 2>&1 | awk '/^ HTTP/{print $2}')
|
||||||
|
# Get the last code (redirections)
|
||||||
|
code="${code##*$'\n'}"
|
||||||
|
|
||||||
if [[ $setup == '-vbeta' ]]; then
|
|
||||||
echo ""
|
|
||||||
sudo wget --timeout=15 -qrO $HOME/webinoly.tar https://qrok.es/wytarb
|
|
||||||
echo "$(tput setaf 1)"
|
echo "$(tput setaf 1)"
|
||||||
echo "[WARNING] You are installing a BETA version of Webinoly and it's not recommended for production enviroments. $(tput sgr0)"
|
if [[ $code == 200 ]]; then
|
||||||
|
sudo wget --timeout=15 -qrO $HOME/webinoly.tar https://qrok.es/webinoly?version=$ver
|
||||||
|
webyversion="$ver"
|
||||||
|
[[ $ver == "beta" ]] && echo "[WARNING] You are installing a BETA version of Webinoly and it's not recommended for production enviroments. $(tput sgr0)"
|
||||||
|
else
|
||||||
|
echo "[ERROR] Version not found or not available! ($code) $(tput sgr0)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
sudo wget --timeout=15 -qrO $HOME/webinoly.tar https://qrok.es/wytar
|
sudo wget --timeout=15 -qrO $HOME/webinoly.tar https://qrok.es/wytar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[[ ! -d /opt/webinoly ]] && sudo mkdir /opt/webinoly
|
||||||
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly
|
sudo tar -xf $HOME/webinoly.tar -C /opt/webinoly
|
||||||
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
sudo find /opt/webinoly -type d -exec chmod 755 {} \;
|
||||||
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
sudo find /opt/webinoly -type f -exec chmod 644 {} \;
|
||||||
|
@ -67,7 +76,8 @@ if [[ -a /opt/webinoly/webinoly.conf && -n $(conf_read tools-port) ]]; then
|
||||||
echo "${gre}Webinoly Configuration file was found, so we will use it!${end}"
|
echo "${gre}Webinoly Configuration file was found, so we will use it!${end}"
|
||||||
else
|
else
|
||||||
portools="22222"
|
portools="22222"
|
||||||
[[ -n "$2" ]] && portools="$2"
|
[[ -n $2 && $2 != "-ver="* ]] && portools="$2"
|
||||||
|
echo $portools
|
||||||
tools_port $portools
|
tools_port $portools
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -76,10 +86,10 @@ conf_write app-version $webyversion
|
||||||
|
|
||||||
|
|
||||||
# Stack installation
|
# Stack installation
|
||||||
[[ $setup -gt 0 && $setup != 4 ]] && stack -nginx
|
[[ $setup -gt 0 && $setup -lt 4 ]] && stack -nginx
|
||||||
[[ $setup -gt 1 && $setup != 4 ]] && stack -php
|
[[ $setup -gt 1 && $setup -lt 4 ]] && stack -php
|
||||||
[[ $setup -gt 2 && $setup != 4 ]] && stack -mysql
|
[[ $setup == 3 ]] && stack -mysql
|
||||||
[[ $setup == 4 ]] && config_load
|
[[ $setup == 4 ]] && source /opt/webinoly/lib/webin; config_load
|
||||||
|
|
||||||
|
|
||||||
# Remove Installation File
|
# Remove Installation File
|
||||||
|
|
Loading…
Reference in a new issue