Added variable mogodb version

This commit is contained in:
2021-01-16 03:34:09 +01:00
parent 97d79cdbcf
commit e0e312c393
2 changed files with 12 additions and 11 deletions

View File

@@ -1,3 +0,0 @@
git clone https://git.bprieshof.nl/Tools/ShellHubNative
cd ShellHubNative/Server
bash install.sh

View File

@@ -1,10 +1,14 @@
##Build of a release tag ##Build of a release tag
RelVer=stable #RelVer=stable
##Build of a master branch, but config is vaidated ##Build of a master branch, but config is vaidated
#RelVer=latest_Tested RelVer=latest_Tested
##Build of a master branch ##Build of a master branch
#RelVer=latest #RelVer=latest
#Use 3.6, or lower (only avalible on ubuntu 18.04 or debian 9) for current 'stable' release (v0.4.2),
#4.4 works on current 'latest' and ' latest_Tested'
MongoVer=4.4
#Go to script directory #Go to script directory
cd "$(dirname "$0")" cd "$(dirname "$0")"
#Setting up services needed for ShellHub #Setting up services needed for ShellHub
@@ -13,17 +17,17 @@ mkdir -p /opt/ShellHub/{ui,keys,tools}
apt-get -y install --no-install-recommends wget gnupg ca-certificates openssl uuid-runtime apt-get -y install --no-install-recommends wget gnupg ca-certificates openssl uuid-runtime
###addding mongoDB and openresty Repos ###addding mongoDB and openresty Repos
wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - wget -qO - https://www.mongodb.org/static/pgp/server-$MongoVer.asc | apt-key add -
if [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "debian" ]; then if [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "debian" ]; then
echo "deb http://openresty.org/package/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"') openresty" > /etc/apt/sources.list.d/openresty.list echo "deb http://openresty.org/package/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"') openresty" > /etc/apt/sources.list.d/openresty.list
echo "deb http://repo.mongodb.org/apt/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/4.4 main" > /etc/apt/sources.list.d/mongodb-org-4.4.list echo "deb http://repo.mongodb.org/apt/debian $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer main" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list
elif [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "ubuntu" ]; then elif [ "$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")" = "ubuntu" ]; then
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-4.4.list echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"')/mongodb-org/$MongoVer multiverse" > /etc/apt/sources.list.d/mongodb-org-$MongoVer.list
echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/openresty.list echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/openresty.list
fi fi
##Installing packages ##Installing packages
apt-get update apt-get update
apt install -y openresty mongodb-org apt install -y openresty openresty-opm mongodb-org
##Configuring external services ##Configuring external services
opm get bungle/lua-resty-template opm get bungle/lua-resty-template
systemctl stop openresty mongod systemctl stop openresty mongod
@@ -31,9 +35,9 @@ systemctl enable openresty mongod
# config openresty(nginx) # config openresty(nginx)
rm /etc/openresty/nginx.conf rm /etc/openresty/nginx.conf
wget https://git.bprieshof.nl/ci/Releases/ShellHub/"$RelVer"/nginx.env -O /opt/ShellHub/nginx.env wget https://git.bprieshof.nl/ci/Releases/ShellHub/"$RelVer"/nginx.env -O /opt/ShellHub/nginx.env
mv config/openresty.conf /etc/openresty/nginx.conf mv config/openresty.conf /usr/local/openresty/nginx/conf/nginx.conf
mkdir /var/run/openresty mkdir /var/run/openresty
echo "d /var/run/openresty 0755 root root - -" > /usr/lib/tmpfiles.d/php-custom.conf echo "d /var/run/openresty 0755 root root - -" > /usr/lib/tmpfiles.d/openresty-custom.conf
echo " 127.0.0.1 ui api ssh mongo" > /etc/hosts echo " 127.0.0.1 ui api ssh mongo" > /etc/hosts
systemctl start openresty mongod systemctl start openresty mongod