remove useless installer reliques

This commit is contained in:
Adrien Marquès 2018-06-10 18:22:44 +02:00
parent 657724d58d
commit 9c829c3d82
3 changed files with 0 additions and 262 deletions

View File

@ -1,40 +0,0 @@
#!/bin/bash
#*************************#
# RELEASER:formatter #
#*************************#
# Designed & Developed by #
# Adrien Marquès #
# <xdrm-brackets> #
#*************************#
# git.xdrm.io #
#*************************#
S="12"
# (1) Creates a fixed inline progress
#--------------------------------------------------------#
set_inline_progress_size(){
test ! -z "$1" && test "`expr $1 + 0 2>/dev/null`" = "$1" && export S="$1"
}
inline_progress(){
# 1. init arguments
text=""
size="$S"
sep=" "
# 2. extract text
test ! -z "$1" && text="$1";
# 3. extract size
test ! -z "$2" && test "`expr $2 + 0 2>/dev/null`" = "$2" && size="$2";
# 4. Write text
len="`echo -n \"$text\" | wc -m`";
echo -n "$text";
for i in `seq $len $size`; do echo -n "$sep"; done;
return;
}

View File

@ -1,19 +0,0 @@
#!/bin/bash
#!/bin/bash
#*************************#
# RELEASER:main #
#*************************#
# Designed & Developed by #
# Adrien Marquès #
# <xdrm-brackets> #
#*************************#
# git.xdrm.io #
#*************************#
git clone --recursive https://git.xdrm.io/ptut/virtenv.git ptut.virtenv \
&& mkdir -p ./ptut.virtenv/metactl/persistent \
&& curl https://xdrm.io/script/ptut-database > ./ptut.virtenv/metactl/persistent/mariadb.sql \
&& bash -c "`curl https://xdrm.io/script/ptut-rp`" -s 8080 -i \
&& make -C ./ptut.virtenv start \
&& xdg-open http://ptut.com:8080;

View File

@ -1,203 +0,0 @@
#!/bin/bash
#*************************#
# RELEASER:reverse-proxy #
#*************************#
# Designed & Developed by #
# Adrien Marquès #
# <xdrm-brackets> #
#*************************#
# git.xdrm.io #
#*************************#
install_nginx(){
echo -e "\e[33m>\e[0m nginx installer \e[33m<\e[0m\n"
CNF_ROOT="/etc/nginx"
# (1) Check config location #
errcount="0";
ls $CNF_ROOT >/dev/null 2>&1; errcount="`expr $errcount + $?`";
ls $CNF_ROOT/sites-available >/dev/null 2>&1; errcount="`expr $errcount + $?`";
ls $CNF_ROOT/sites-enabled >/dev/null 2>&1; errcount="`expr $errcount + $?`";
if [ "$errcount" -gt 0 ]; then
echo -e " \e[33m/!\\\\\e[0m Invalid configuration structure in $CNF_ROOT."
echo -e " expected \e[33msites-available\e[0m and \e[33msites-enabled\e[0m mechanism."
exit 1;
fi
# (3) Ask server name #
read -p "[server name] (ptut.example.com): " server_name;
if [ -z "$server_name" ]; then
echo -e " \e[33m/!\\\\\e[0m Invalid server name."
exit 1;
fi;
# copy in /etc/hosts
echo -e "127.0.0.1\t$server_name" | sudo tee -a /etc/hosts >/dev/null;
# (3) Copy config #
echo "1- build configuration"
echo """server {
listen 80;
server_name $server_name www.$server_name;
location / {
proxy_set_header Host \$host;
proxy_pass http://127.0.0.1:$PORT;
}
}""" | sudo tee $CNF_ROOT/sites-available/ptut.reverse-proxy > /dev/null
# manage error
if [ "$?" -ne 0 ]; then
echo -e " \e[33m/!\\\\\e[0m You must have 'sudo' permissions."
exit 1;
fi;
# (4) Setup nginx #
echo "2- enable configuration"
sudo ln -fs ../sites-available/ptut.reverse-proxy $CNF_ROOT/sites-enabled/ptut.reverse-proxy;
sudo systemctl reload nginx;
echo -e "\e[33m>\e[0m done \e[33m<\e[0m"
}
install_httpd(){
echo -e "\e[33m>\e[0m httpd installer \e[33m<\e[0m\n"
echo "no installer for now...\n"
exit 1
}
install_apache(){
echo -e "\e[33m>\e[0m apache installer \e[33m<\e[0m\n"
CNF_ROOT="/etc/apache2"
# (1) Check config location #
errcount="0";
ls $CNF_ROOT >/dev/null 2>&1; errcount="`expr $errcount + $?`";
ls $CNF_ROOT/sites-available >/dev/null 2>&1; errcount="`expr $errcount + $?`";
ls $CNF_ROOT/sites-enabled >/dev/null 2>&1; errcount="`expr $errcount + $?`";
if [ "$errcount" -gt 0 ]; then
echo -e " \e[33m/!\\\\\e[0m Invalid configuration structure in $CNF_ROOT."
echo -e " expected \e[33msites-available\e[0m and \e[33msites-enabled\e[0m mechanism."
exit 1;
fi
# (3) Ask server name #
read -p "[server name] (ptut.example.com): " server_name;
if [ -z "$server_name" ]; then
echo -e " \e[33m/!\\\\\e[0m Invalid server name."
exit 1;
fi;
# copy in /etc/hosts
echo -e "127.0.0.1\t$server_name" | sudo tee -a /etc/hosts >/dev/null;
# (3) Copy config #
echo "1- build configuration"
echo """<VirtualHost *:80>
ServerName $server_name
ServerAlias www.$server_name
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://127.0.0.1:$PORT/
ProxyPassReverse / http://127.0.0.1:$PORT/
</VirtualHost>""" | sudo tee $CNF_ROOT/sites-available/ptut.reverse-proxy > /dev/null
# manage error
if [ "$?" -ne 0 ]; then
echo -e " \e[33m/!\\\\\e[0m You must have 'sudo' permissions."
exit 1;
fi;
# (4) Setup nginx #
echo "2- enable configuration"
sudo ln -fs ../sites-available/ptut.reverse-proxy $CNF_ROOT/sites-enabled/ptut.reverse-proxy;
sudo systemctl reload apache2;
echo -e "\e[33m>\e[0m done \e[33m<\e[0m"
}
# (1) Set optional port
#--------------------------------------------------------#
# (1) Default value #
PORT="8080";
# (2) If port given as argument[0] #
if [ "$#" -ge 1 ]; then
# fail if invalid number
if [ "`expr $1 + 0 2>/dev/null`" != "$1" ]; then
echo -e "\e[33m/!\\\\\e[0m Invalid port (expected a number)"
exit 1
fi;
PORT="`expr $1 + 0`"
fi;
# (2) Detect installed/running HTTP server
#--------------------------------------------------------#
# (1) Check for existing services #
is_nginx="$(test `systemctl status nginx 2>/dev/null | wc -l` -gt 1 && echo 1 || echo 0)"
is_httpd="$(test `systemctl status httpd 2>/dev/null | wc -l` -gt 1 && echo 1 || echo 0)"
is_apache2="$(test `systemctl status apache2 2>/dev/null | wc -l` -gt 1 && echo 1 || echo 0)"
candidate_n="`expr $is_nginx + $is_httpd + $is_apache2`"
# (2) No candidate #
if [ "$candidate_n" -lt 1 ]; then
echo -e "\e[33m/!\\\\\e[0m You have no HTTP server installed.\n"
echo -e "> install \e[33mnginx\e[0m or \e[33mapache/httpd\e[0m"
exit 1
# (3) One candidate -> automatic select #
elif [ "$candidate_n" -eq 1 ]; then
test "$is_nginx" = "1" && install_nginx;
test "$is_httpd" = "1" && install_httpd;
test "$is_apache2" = "1" && install_apache2;
# (4) Multiple choices #
else
echo "installation candidate:"
test "$is_nginx" = "1" && echo -e " [\e[33mN\e[0m] nginx"
test "$is_httpd" = "1" && echo -e " [\e[33mH\e[0m] httpd (apache)"
test "$is_apache2" = "1" && echo -e " [\e[33mA\e[0m] apache2"
read -p "> " -n1 candidate; echo
case $candidate in
"n"|"N")
if [ "$is_nginx" != "1" ]; then
echo -e "\e[33m/!\\\\\e[0m Invalid choice... aborting"; exit 1;
fi;
install_nginx
;;
"h"|"H")
if [ "$is_httpd" != "1" ]; then
echo -e "\e[33m/!\\\\\e[0m Invalid choice... aborting"; exit 1;
fi;
install_httpd
;;
"a"|"A")
if [ "$is_apache2" != "1" ]; then
echo -e "\e[33m/!\\\\\e[0m Invalid choice... aborting"; exit 1;
fi;
install_apache
;;
*) echo -e "\e[33m/!\\\\\e[0m Invalid choice... aborting"; exit 1;;
esac;
fi;
exit 0