Commit afaf6adb authored by w4t's avatar w4t

wtserver 0.02

parent 432ce64f
...@@ -41,14 +41,14 @@ AskQuestions() { ...@@ -41,14 +41,14 @@ AskQuestions() {
CFG_WEBSERVER=${CFG_WEBSERVER,,} CFG_WEBSERVER=${CFG_WEBSERVER,,}
while [ "x$CFG_FTP" == "x" ]; do while [ "x$CFG_FTP" == "x" ]; do
CFG_FTP=$(whiptail --title "FTP Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Install and configure FTP SERVER?" $WT_HEIGHT $WT_WIDTH 4 "onlyFTP" "Yes, only with FTP" OFF "onlyTLS" "Yes, only with TLS" ON "FTPandTLS" "Yes, with FTP and TLS" OFF "none" "No, don't install it" OFF 3>&1 1>&2 2>&3) CFG_FTP=$(whiptail --title "FTP Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Install and configure FTP SERVER?" $WT_HEIGHT $WT_WIDTH 4 "onlyTLS" "Yes, only with TLS" ON "onlyFTP" "Yes, only with FTP" OFF "FTPandTLS" "Yes, with FTP and TLS" OFF "none" "No, don't install it" OFF 3>&1 1>&2 2>&3)
done done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} " echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install and Configure FTP Server${NC}: ${green}$CFG_FTP${NC} "
echo echo
while [[ ! "$CFG_MTA" =~ $RE ]]; do while [[ ! "$CFG_MTA" =~ $RE ]]; do
CFG_MTA=$(whiptail --title "Mail Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select mailserver type" $WT_HEIGHT $WT_WIDTH 3 "None" "" OFF "Dovecot" "(default)" ON "Courier" "" OFF 3>&1 1>&2 2>&3) CFG_MTA=$(whiptail --title "Mail Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select mailserver type" $WT_HEIGHT $WT_WIDTH 3 "Dovecot" "(default)" ON "Courier" "" OFF "None" "" OFF 3>&1 1>&2 2>&3)
done done
CFG_MTA=${CFG_MTA,,} CFG_MTA=${CFG_MTA,,}
...@@ -61,7 +61,7 @@ AskQuestions() { ...@@ -61,7 +61,7 @@ AskQuestions() {
else else
CFG_SETUP_MAIL=true CFG_SETUP_MAIL=true
while [[ ! "$CFG_WEBMAIL" =~ $RE ]]; do while [[ ! "$CFG_WEBMAIL" =~ $RE ]]; do
CFG_WEBMAIL=$(whiptail --title "Webmail client" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select which Web Mail client you want" $WT_HEIGHT $WT_WIDTH 6 "Roundcube" "(default)" OFF "Roundcube-latest" "latest available" ON "RainLoop" "" OFF "SOGo" "" OFF "Squirrelmail" "" OFF "None" "No Web Mail Client" OFF 3>&1 1>&2 2>&3) CFG_WEBMAIL=$(whiptail --title "Webmail client" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select which Web Mail client you want" $WT_HEIGHT $WT_WIDTH 6 "Roundcube-latest" "latest available" ON "Roundcube" "(default)" OFF "RainLoop" "" OFF "SOGo" "" OFF "Squirrelmail" "" OFF "None" "No Web Mail Client" OFF 3>&1 1>&2 2>&3)
done done
if [ $CFG_WEBMAIL != "none" ] || [ $CFG_WEBMAIL != "squirrelmail" ]; then if [ $CFG_WEBMAIL != "none" ] || [ $CFG_WEBMAIL != "squirrelmail" ]; then
...@@ -99,7 +99,7 @@ AskQuestions() { ...@@ -99,7 +99,7 @@ AskQuestions() {
echo echo
if [[ ! "$CFG_MAILMAN" =~ $RE ]]; then if [[ ! "$CFG_MAILMAN" =~ $RE ]]; then
if (whiptail --title "Mailman" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Mailman?" $WT_HEIGHT $WT_WIDTH); then if (whiptail --title "Mailman" --backtitle "$WT_BACKTITLE" --yesno --defaultno "Would you like to install Mailman?" $WT_HEIGHT $WT_WIDTH); then
CFG_MAILMAN=yes CFG_MAILMAN=yes
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site password${NC}: " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Mailman site password${NC}: "
...@@ -167,22 +167,24 @@ AskQuestions() { ...@@ -167,22 +167,24 @@ AskQuestions() {
echo echo
while [ "x$CFG_CERTBOT_VERSION" == "x" ]; do while [ "x$CFG_CERTBOT_VERSION" == "x" ]; do
CFG_CERTBOT_VERSION=$(whiptail --title "Install LetsEncrypt CertBot" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select CertBot Version" $WT_HEIGHT $WT_WIDTH 3 "None" "No installation" OFF "Certbot" "Certbot" OFF "Acme.sh" "Acme.sh" ON 3>&1 1>&2 2>&3) CFG_CERTBOT_VERSION=$(whiptail --title "Install LetsEncrypt CertBot" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select CertBot Version" $WT_HEIGHT $WT_WIDTH 3 "Acme.sh" "Acme.sh" ON "Certbot" "Certbot" OFF "None" "No installation" OFF 3>&1 1>&2 2>&3)
done done
echo -n -e "$IDENTATION_LVL_1 ${BBlack}LetsEncrypt CertBot Version${NC}: ${green}$CFG_CERTBOT_VERSION${NC} " echo -n -e "$IDENTATION_LVL_1 ${BBlack}LetsEncrypt CertBot Version${NC}: ${green}$CFG_CERTBOT_VERSION${NC} "
echo echo
while [[ ! "$CFG_PHPMYADMIN" =~ $RE ]]; do if whiptail --title "Install phpMyAdmin" --backtitle "$WT_BACKTITLE" --yesno "Do you want to install phpMyAdmin?" $WT_HEIGHT $WT_WIDTH; then
CFG_PHPMYADMIN=$(whiptail --title "Install phpMyAdmin" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install phpMyAdmin?" $WT_HEIGHT $WT_WIDTH 2 "Yes" "(default)" ON "No" "" OFF 3>&1 1>&2 2>&3) CFG_PHPMYADMIN="yes"
done else
CFG_PHPMYADMIN="no"
fi
echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install PhpMyAdmin${NC}: ${green}$CFG_PHPMYADMIN${NC} " echo -n -e "$IDENTATION_LVL_1 ${BBlack}Install PhpMyAdmin${NC}: ${green}$CFG_PHPMYADMIN${NC} "
echo echo
if [ $CFG_PHPMYADMIN == "yes" ]; then if [ $CFG_PHPMYADMIN == "yes" ]; then
while [ "x$CFG_PHPMYADMIN_VERSION" == "x" ]; do while [ "x$CFG_PHPMYADMIN_VERSION" == "x" ]; do
CFG_PHPMYADMIN_VERSION=$(whiptail --title "phpMyAdmin Version" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "What version of phpMyAdmin do you want to install?" $WT_HEIGHT $WT_WIDTH 4 "Default" "Current OS Version" OFF "Buster" "From buster backports - newer" OFF "Bullseye" "From bullseye backports - newer" OFF "Latest-stable" "from phpMyAdmin.net" ON 3>&1 1>&2 2>&3) CFG_PHPMYADMIN_VERSION=$(whiptail --title "phpMyAdmin Version" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "What version of phpMyAdmin do you want to install?" $WT_HEIGHT $WT_WIDTH 4 "Latest-stable" "from phpMyAdmin.net" ON "Default" "Current OS Version" OFF "Buster" "From buster backports - newer" OFF "Bullseye" "From bullseye backports - newer" OFF 3>&1 1>&2 2>&3)
done done
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Version${NC}: ${green}$CFG_PHPMYADMIN_VERSION${NC} " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Version${NC}: ${green}$CFG_PHPMYADMIN_VERSION${NC} "
...@@ -237,10 +239,11 @@ AskQuestions() { ...@@ -237,10 +239,11 @@ AskQuestions() {
# CFG_JOOMLA=$(whiptail --title "Install CMS" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select the default CMS" 10 50 2 "joomla" "(default)" ON "drupal" "" OFF 3>&1 1>&2 2>&3) # CFG_JOOMLA=$(whiptail --title "Install CMS" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select the default CMS" 10 50 2 "joomla" "(default)" ON "drupal" "" OFF 3>&1 1>&2 2>&3)
#done #done
if whiptail --title "Install GitLab Server" --backtitle "$WT_BACKTITLE" --yesno "Do you want to install GitLab Server?" $WT_HEIGHT $WT_WIDTH; then
while [ "x$CFG_GITLABINSTALL" == "x" ]; do CFG_GITLABINSTALL="yes"
CFG_GITLABINSTALL=$(whiptail --title "Install Gitlab Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install Gitlab Server?" $WT_HEIGHT $WT_WIDTH 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) else
done CFG_GITLABINSTALL="no"
fi
if [ "$CFG_GITLABINSTALL" == "yes" ]; then if [ "$CFG_GITLABINSTALL" == "yes" ]; then
echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Gitlab Admin password${NC}: " echo -n -e "$IDENTATION_LVL_2 ${BBlack}Retrieve Gitlab Admin password${NC}: "
...@@ -251,9 +254,11 @@ AskQuestions() { ...@@ -251,9 +254,11 @@ AskQuestions() {
fi fi
fi fi
while [ "x$CFG_CLOUDINSTALL" == "x" ]; do if whiptail --title "Install Cloud Server" --backtitle "$WT_BACKTITLE" --yesno "Do you want to install a Cloud Server?" $WT_HEIGHT $WT_WIDTH; then
CFG_CLOUDINSTALL=$(whiptail --title "Install Cloud Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install a Cloud Server?" $WT_HEIGHT $WT_WIDTH 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) CFG_CLOUDINSTALL="yes"
done else
CFG_CLOUDINSTALL="no"
fi
if [ "$CFG_CLOUDINSTALL" == "yes" ]; then if [ "$CFG_CLOUDINSTALL" == "yes" ]; then
while [ "x$CFG_CLOUDTYPE" == "x" ]; do while [ "x$CFG_CLOUDTYPE" == "x" ]; do
...@@ -262,11 +267,10 @@ AskQuestions() { ...@@ -262,11 +267,10 @@ AskQuestions() {
if [ "$CFG_CLOUDTYPE" == "nextcloud" ]; then if [ "$CFG_CLOUDTYPE" == "nextcloud" ]; then
while [ "x$CFG_CLOUDUPGRADE" == "x" ]; do while [ "x$CFG_CLOUDUPGRADE" == "x" ]; do
CFG_CLOUDUPGRADE=$(whiptail --title "Install Or Upgrade Nextcloud Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to upgrade Owncloud to Nextcloud Server or Fresh install?" $WT_HEIGHT $WT_WIDTH 2 "yes" "(Upgrade)" OFF "no" "(Fresh install)" ON 3>&1 1>&2 2>&3) CFG_CLOUDUPGRADE=$(whiptail --title "Install Or Upgrade Nextcloud Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to upgrade Owncloud to Nextcloud Server or Fresh install?" $WT_HEIGHT $WT_WIDTH 2 "no" "(Fresh install)" ON "yes" "(Upgrade)" OFF 3>&1 1>&2 2>&3)
done done
fi fi
if [ "$CFG_CLOUDTYPE" == "seafile" ]; then if [ "$CFG_CLOUDTYPE" == "seafile" ]; then
while [ "x$CFG_SEAFILEVERSION" == "x" ]; do while [ "x$CFG_SEAFILEVERSION" == "x" ]; do
CFG_SEAFILEVERSION=$(whiptail --title "Seafile Version" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Which Seafile version would you like to install?" $WT_HEIGHT $WT_WIDTH 2 "pro" "Seafile Pro" OFF "community" "Seafile Community Edition" ON 3>&1 1>&2 2>&3) CFG_SEAFILEVERSION=$(whiptail --title "Seafile Version" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Which Seafile version would you like to install?" $WT_HEIGHT $WT_WIDTH 2 "pro" "Seafile Pro" OFF "community" "Seafile Community Edition" ON 3>&1 1>&2 2>&3)
......
...@@ -146,7 +146,7 @@ default-authentication-plugin=mysql_native_password ...@@ -146,7 +146,7 @@ default-authentication-plugin=mysql_native_password
unset DEBIAN_FRONTEND unset DEBIAN_FRONTEND
elif [ $CFG_SQLSERVER == "MariaDB" ]; then elif [ $CFG_SQLSERVER == "MariaDB" ]; then
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing MariaDB...\n" echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing MariaDB...{NC}\n"
echo -n -e "$IDENTATION_LVL_1 Setting debconf selections... " echo -n -e "$IDENTATION_LVL_1 Setting debconf selections... "
echo "maria-server-11.8.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections echo "maria-server-11.8.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections
...@@ -159,10 +159,10 @@ default-authentication-plugin=mysql_native_password ...@@ -159,10 +159,10 @@ default-authentication-plugin=mysql_native_password
yes | add-apt-repository 'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 yes | add-apt-repository 'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main' >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
apt_update apt_update
apt_install mariadb-client mariadb-server apt_install mariadb-client mariadb-server
echo -e "[${green}DONE${NC}]"
#Galera cluster #Galera cluster
#apt_install mariadb-backup galera-4 #apt_install mariadb-backup galera-4
echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Configuring MariaDB... " echo -n -e "$IDENTATION_LVL_1 Configuring MariaDB... "
sed -i 's/bind-address.* = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf >> $PROGRAMS_INSTALL_LOG_FILES 2>&1 sed -i 's/bind-address.* = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
......
...@@ -98,16 +98,21 @@ InstallWebServer() { ...@@ -98,16 +98,21 @@ InstallWebServer() {
#echo "deb http://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list #echo "deb http://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list
#curl -O https://nginx.org/keys/nginx_signing.key && apt-key add ./nginx_signing.key #curl -O https://nginx.org/keys/nginx_signing.key && apt-key add ./nginx_signing.key
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg
curl -sSL https://packages.sury.org/nginx-mainline/README.txt | sudo bash -x >>$PROGRAMS_INSTALL_LOG_FILES 2>&1 echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian/ bookworm nginx" | sudo tee /etc/apt/sources.list.d/nginx.list > /dev/null
apt_update apt_update
#apt_install nginx-core nginx nginx-common nginx-module-geoip nginx-module-image-filter nginx-module-njs nginx-module-perl nginx-module-xslt #curl -sSL https://packages.sury.org/nginx-mainline/README.txt | sudo bash -x >>$PROGRAMS_INSTALL_LOG_FILES 2>&1
#apt_update
#itt más csomag nevek vannak
apt_install nginx-full nginx-module-geoip nginx-module-image-filter apt_install nginx-full nginx-module-geoip nginx-module-image-filter
systemctl start nginx systemctl start nginx
systemctl enable nginx systemctl enable nginx
#apt_install nginx-core nginx nginx-common nginx-module-geoip nginx-module-image-filter nginx-module-njs nginx-module-perl nginx-module-xslt
mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled mkdir -p /etc/nginx/sites-available /etc/nginx/sites-enabled
rm /etc/nginx/conf.d/default.conf rm /etc/nginx/conf.d/default.conf
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old
......
...@@ -3,76 +3,74 @@ ...@@ -3,76 +3,74 @@
# Perform pre-installation checks # Perform pre-installation checks
#--------------------------------------------------------------------- #---------------------------------------------------------------------
PreInstallCheck() { PreInstallCheck() {
START_TIME=$SECONDS START_TIME=$SECONDS
echo -e "$IDENTATION_LVL_0 ${BWhite}Performing pre-installation checks...${NC}\n" echo -e "$IDENTATION_LVL_0 ${BWhite}Performing pre-installation checks...${NC}\n"
# Check if no arguments are passed # Check if no arguments are passed
if [[ "$#" -ne 0 ]]; then if [[ "$#" -ne 0 ]]; then
echo -e "Usage: sudo $0" >&2 echo -e "Usage: sudo $0" >&2
exit 1 exit 1
fi fi
# Check if the current user is root # Check if the current user is root
echo -n -e "$IDENTATION_LVL_1 Checking if the current user is root..." echo -n -e "$IDENTATION_LVL_1 Checking if the current user is root... "
if [[ $(id -u) -ne 0 ]]; then if [[ $(id -u) -ne 0 ]]; then
echo -e " [ ${red}ERROR${NC}: You must be root to run this script. Please use the root user or sudo. ]" echo -e " [${red}ERROR${NC}: You must be root to run this script. Please use the root user or sudo.]"
exit 1 exit 1
fi fi
echo -e " [ ${green}OK${NC} ]" echo -e "[${green}OK${NC}]"
# Check if the operating system is Linux # Check if the operating system is Linux
echo -n -e "$IDENTATION_LVL_1 Checking if the OS is Linux..." echo -n -e "$IDENTATION_LVL_1 Checking if the OS is Linux... "
if ! echo "$OSTYPE" | grep -iq "linux"; then if ! echo "$OSTYPE" | grep -iq "linux"; then
echo -e " [ ${red}ERROR${NC}: This script must be run on Linux. ]" echo -e "[${red}ERROR${NC}: This script must be run on Linux.]"
exit 1 exit 1
fi fi
echo -e " [ ${green}OK${NC} ]" echo -e "[${green}OK${NC}]"
# Check available RAM memory # Check available RAM memory
echo -n -e "$IDENTATION_LVL_1 Checking available RAM memory..." echo -n -e "$IDENTATION_LVL_1 Checking available RAM memory... "
TOTAL_PHYSICAL_MEM=$(awk '/^MemTotal:/ {print $2}' /proc/meminfo) TOTAL_PHYSICAL_MEM=$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)
TOTAL_SWAP=$(awk '/^SwapTotal:/ {print $2}' /proc/meminfo) # Added swap memory check TOTAL_SWAP=$(awk '/^SwapTotal:/ {print $2}' /proc/meminfo) # Added swap memory check
TOTAL_MEMORY=$((TOTAL_PHYSICAL_MEM + TOTAL_SWAP)) # Combine RAM and swap for total memory TOTAL_MEMORY=$((TOTAL_PHYSICAL_MEM + TOTAL_SWAP)) # Combine RAM and swap for total memory
if [ "$TOTAL_MEMORY" -lt 524288 ]; then if [ "$TOTAL_MEMORY" -lt 524288 ]; then
echo -e " [ ${red}ERROR${NC}: This machine has $(($TOTAL_PHYSICAL_MEM / 1024)) MiB RAM and $(($TOTAL_SWAP / 1024)) MiB swap. ISPConfig requires at least 512 MiB (1 GiB recommended) of total memory. ]" echo -e " [ ${red}ERROR${NC}: This machine has $(($TOTAL_PHYSICAL_MEM / 1024)) MiB RAM and $(($TOTAL_SWAP / 1024)) MiB swap. ISPConfig requires at least 512 MiB (1 GiB recommended) of total memory. ]"
exit 1 exit 1
fi fi
echo -e " [ ${green}OK${NC} ]" echo -e "[${green}OK${NC}]"
# Check internet connectivity by pinging ISPConfig servers # Check internet connectivity by pinging ISPConfig servers
echo -n -e "$IDENTATION_LVL_1 Checking internet connectivity..." echo -n -e "$IDENTATION_LVL_1 Checking internet connectivity... "
if ! ping -q -c 3 www.ispconfig.org >>$PROGRAMS_INSTALL_LOG_FILES 2>&1; then if ! ping -q -c 3 www.ispconfig.org >>$PROGRAMS_INSTALL_LOG_FILES 2>&1; then
echo -e " [ ${red}ERROR${NC}: Could not reach www.ispconfig.org. Please check your internet connection and run this script again. ]" echo -e "[${red}ERROR${NC}: Could not reach www.ispconfig.org. Please check your internet connection and run this script again.]"
exit 1 exit 1
fi fi
echo -e " [ ${green}OK${NC} ]" echo -e "[${green}OK${NC}]"
# Check if a previous version of ISPConfig is installed # Check if a previous version of ISPConfig is installed
echo -n -e "$IDENTATION_LVL_1 Checking for previous ISPConfig installations..." echo -n -e "$IDENTATION_LVL_1 Checking for previous ISPConfig installations... "
if [ -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then if [ -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then
echo -e " [ ${red}ERROR${NC}: ISPConfig is already installed. Aborting. ]" echo -e "[${red}ERROR${NC}: ISPConfig is already installed. Aborting.]"
exit 1 exit 1
fi fi
echo -e " [ ${green}OK${NC} ]" echo -e "[${green}OK${NC}]"
# Update /etc/apt/sources.list to include contrib and non-free repositories # Update /etc/apt/sources.list to include contrib and non-free repositories
echo -n -e "$IDENTATION_LVL_1 Updating /etc/apt/sources.list..." echo -n -e "$IDENTATION_LVL_1 Updating /etc/apt/sources.list... "
contrib=$(grep 'contrib' /etc/apt/sources.list | grep -v "cdrom") contrib=$(grep 'contrib' /etc/apt/sources.list | grep -v "cdrom")
nonfree=$(grep -E 'non-free([^-]|$)' /etc/apt/sources.list | grep -v "cdrom") nonfree=$(grep -E 'non-free([^-]|$)' /etc/apt/sources.list | grep -v "cdrom")
if [ -z "$contrib" ]; then if [ -z "$contrib" ]; then
if [ -z "$nonfree" ]; then if [ -z "$nonfree" ]; then
sed -i 's/main/main contrib non-free/' /etc/apt/sources.list sed -i 's/main/main contrib non-free/' /etc/apt/sources.list
else else
sed -i 's/main/main contrib/' /etc/apt/sources.list sed -i 's/main/main contrib/' /etc/apt/sources.list
fi
elif [ -z "$nonfree" ]; then
sed -i 's/main/main non-free/' /etc/apt/sources.list
fi fi
elif [ -z "$nonfree" ]; then echo -e "[${green}DONE${NC}]"
sed -i 's/main/main non-free/' /etc/apt/sources.list
fi
echo -e " [ ${green}DONE${NC} ]\n"
MeasureTimeDuration $START_TIME MeasureTimeDuration $START_TIME
} }
...@@ -42,12 +42,12 @@ APWD=$(pwd); ...@@ -42,12 +42,12 @@ APWD=$(pwd);
#Those lines are for logging porpuses #Those lines are for logging porpuses
mkdir -p $APWD/tmp/{logs,sqls,downloads} mkdir -p $APWD/tmp/{logs,sqls,downloads}
echo -e "$IDENTATION_LVL_0 ${BWhite}Create needed directories${NC}" echo -e "$IDENTATION_LVL_0 ${BWhite}Create needed directories${NC}"
echo -e " - ${BWhite}Temp Folder:${NC} ${BBlack}tmp/${NC} [ ${green}DONE${NC} ]" echo -e " - ${BWhite}Temp Folder:${NC} ${BBlack}tmp/${NC} [${green}DONE${NC}]"
echo -e " - ${BWhite}Logs:${NC} ${BBlack}tmp/logs${NC} [ ${green}DONE${NC} ]" echo -e " - ${BWhite}Logs:${NC} ${BBlack}tmp/logs${NC} [${green}DONE${NC}]"
echo -e " - ${BWhite}SQLs:${NC} ${BBlack}tmp/sqls${NC} [ ${green}DONE${NC} ]" echo -e " - ${BWhite}SQLs:${NC} ${BBlack}tmp/sqls${NC} [${green}DONE${NC}]"
echo -e " - ${BWhite}Downloads:${NC} ${BBlack}tmp/downloads${NC} [ ${green}DONE${NC} ]" echo -e " - ${BWhite}Downloads:${NC} ${BBlack}tmp/downloads${NC} [${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Logging Files${NC}" echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Logging Files${NC} "
exec > >(tee -i tmp/logs/wt_server_setup_programs.log) exec > >(tee -i tmp/logs/wt_server_setup_programs.log)
exec 2>&1 exec 2>&1
...@@ -56,26 +56,24 @@ PROGRAMS_INSTALL_SQLS=$PWD/tmp/sqls ...@@ -56,26 +56,24 @@ PROGRAMS_INSTALL_SQLS=$PWD/tmp/sqls
PROGRAMS_INSTALL_LOG_FILES=$PWD/tmp/logs/wt_server_setup_programs.log PROGRAMS_INSTALL_LOG_FILES=$PWD/tmp/logs/wt_server_setup_programs.log
touch $PROGRAMS_INSTALL_LOG_FILES touch $PROGRAMS_INSTALL_LOG_FILES
echo -e "[ ${green}DONE${NC} ]" echo -e "[${green}DONE${NC}]"
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Global variables # Global variables
#--------------------------------------------------------------------- #---------------------------------------------------------------------
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Global Variable${NC}" echo -n -e "$IDENTATION_LVL_0 ${BWhite}Setup Global Variable${NC} "
CFG_HOSTNAME_FQDN=$(hostname -f) CFG_HOSTNAME_FQDN=$(hostname -f)
WT_BACKTITLE="ISPConfig 3 System Installer By Wolftronics" WT_BACKTITLE="ISPConfig 3 System Installer By Wolftronics"
echo -e "[${green}DONE${NC}]"
echo -e " [ ${green}DONE${NC} ] " echo -e "$IDENTATION_LVL_0 ${BWhite}Checking your system, please wait...${NC} "
echo -e "$IDENTATION_LVL_0 ${BWhite}Checking your system, please wait...${NC}"
#CFG_HOSTNAME_FQDN=$(hostname -f); # hostname -A #CFG_HOSTNAME_FQDN=$(hostname -f); # hostname -A
IP_ADDRESS=( $(hostname -I) ); IP_ADDRESS=( $(hostname -I) );
RE='^2([0-4][0-9]|5[0-5])|1?[0-9][0-9]{1,2}(\.(2([0-4][0-9]|5[0-5])|1?[0-9]{1,2})){3}$' RE_IPv4='^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
IPv4_ADDRESS=( $(for i in ${IP_ADDRESS[*]}; do [[ "$i" =~ $RE ]] && echo "$i"; done) ) IPv4_ADDRESS=( $(for i in "${IP_ADDRESS[@]}"; do [[ "$i" =~ $RE_IPv4 ]] && echo "$i"; done) )
RE='^[[:xdigit:]]{1,4}(:[[:xdigit:]]{1,4}){7}$' RE_IPv6='^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9]))$'
IPv6_ADDRESS=( $(for i in ${IP_ADDRESS[*]}; do [[ "$i" =~ $RE ]] && echo "$i"; done) ) IPv6_ADDRESS=( $(for i in "${IP_ADDRESS[@]}"; do [[ "$i" =~ $RE_IPv6 ]] && echo "$i"; done) )
#WT_BACKTITLE="ISPConfig 3 System Installer from Wolftronics"
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Load needed functions # Load needed functions
...@@ -105,9 +103,9 @@ fi ...@@ -105,9 +103,9 @@ fi
echo -e "$IDENTATION_LVL_0 ${BWhite}System Checking [${NC} ${green}COMPLETED${NC} ${BWhite}]${NC} " echo -e "$IDENTATION_LVL_0 ${BWhite}System Checking [${NC} ${green}COMPLETED${NC} ${BWhite}]${NC} "
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Please give us 2 seconds before continue ${NC} ... " echo -n -e "$IDENTATION_LVL_0 ${BWhite}Please give us 2 seconds before continue ${NC}... "
sleep 2 sleep 2
echo -e " [${NC} ${green}Thanks !${NC} ${BWhite}] " echo -e "[${NC} ${green}Thanks!${NC} ${BWhite}]"
MeasureTimeDuration $SCRIPT_EXECUTION_START_TIME MeasureTimeDuration $SCRIPT_EXECUTION_START_TIME
...@@ -200,14 +198,14 @@ source $APWD/distros/$DISTRO/install_basephp.sh #to remove in feature release ...@@ -200,14 +198,14 @@ source $APWD/distros/$DISTRO/install_basephp.sh #to remove in feature release
#--------------------------------------------------------------------- #---------------------------------------------------------------------
clear clear
echo "Welcome to ISPConfig Setup Script v.3.0.3.1" echo "Welcome to ISPConfig Setup Script v.0.0.0.1"
echo "This software is developed by Temporini Matteo" echo "This software is developed by Farkas-Griecs Zoltán"
echo "with the support of the community." echo "with the support of the community."
echo "You can visit my website at the followings URLs" echo "You can visit my website at the followings URLs"
echo "http://www.wolftronics.hu" echo "http://www.wolftronics.hu"
echo "and contact me with the following information" echo "and contact me with the following information"
echo "contact email/hangout: wolftronics@wolftronics.hu" echo "contact email/hangout: wolftronics@wolftronics.hu"
echo "skype: wolftronics" echo ""
echo "=========================================" echo "========================================="
echo "ISPConfig 3 System Installer" echo "ISPConfig 3 System Installer"
echo "=========================================" echo "========================================="
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment