#!/bin/sh CWD=`pwd` NAME=custombuild WORKDIR=/usr/local/directadmin/${NAME} OPTIONS_CONF=${WORKDIR}/options.conf CUSTOMBUILD_OPT=1.2 INPUT_VALUE=none if [ $# -eq 1 ]; then INPUT_VALUE=$1 fi cd ${CWD} echo -n "" > ${OPTIONS_CONF} # Which version of PHP set as default? if [ "${INPUT_VALUE}" = "d" ]; then phpver=5 else echo -n "Do you want to have PHP5 or PHP6 as default? (5/6): "; read phpver; fi until [ "${phpver}" = "5" ] || [ "${phpver}" = "6" ]; do echo -n "Please enter '5' or '6':" read phpver done echo "#PHP settings. default_php possible values - 5 or 6" >> ${OPTIONS_CONF} echo "default_php=${phpver}" >> ${OPTIONS_CONF} # Which version of PHP5 to install? if [ "${INPUT_VALUE}" = "d" ]; then wantphp5=no else echo -n "Do you want to have PHP5? (yes/no): "; read wantphp5; fi until [ "${wantphp5}" = "yes" ] || [ "${wantphp5}" = "no" ]; do echo -n "Please enter 'yes' or 'no':" read wantphp5 done if [ "${wantphp5}" = "yes" ]; then echo -n "Do you want to have PHP5 as CLI or CGI? (cli/cgi): "; read php5type; until [ "${php5type}" = "cli" ] || [ "${php5type}" = "cgi" ]; do echo -n "Please enter 'cli' or 'cgi':" read php5type; done if [ "${php5type}" = "cli" ]; then echo "php5_cli=yes" >> ${OPTIONS_CONF} echo "php5_cgi=no" >> ${OPTIONS_CONF} elif [ "${php5type}" = "cgi" ]; then echo "php5_cli=no" >> ${OPTIONS_CONF} echo "php5_cgi=yes" >> ${OPTIONS_CONF} fi elif [ "${wantphp5}" = "no" ]; then echo "php5_cli=no" >> ${OPTIONS_CONF} echo "php5_cgi=no" >> ${OPTIONS_CONF} fi # Which version of PHP6 to install? if [ "${INPUT_VALUE}" = "d" ]; then wantphp6=yes else echo -n "Do you want to have PHP6? (yes/no): "; read wantphp6; fi until [ "${wantphp6}" = "yes" ] || [ "${wantphp6}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read wantphp6 done if [ "${wantphp6}" = "yes" ]; then if [ "${INPUT_VALUE}" = "d" ]; then php6type=cli else echo -n "Do you want to have PHP6 as CLI or CGI? (cli/cgi): "; read php6type; fi until [ "${php6type}" = "cli" ] || [ "${php6type}" = "cgi" ]; do echo -n "Please enter 'cli' or 'cgi': " read php6type; done if [ "${php6type}" = "cli" ]; then echo "php6_cli=yes" >> ${OPTIONS_CONF} echo "php6_cgi=no" >> ${OPTIONS_CONF} elif [ "${php6type}" = "cgi" ]; then echo "php6_cli=no" >> ${OPTIONS_CONF} echo "php6_cgi=yes" >> ${OPTIONS_CONF} fi elif [ "${wantphp6}" = "no" ]; then echo "php6_cli=no" >> ${OPTIONS_CONF} echo "php6_cgi=no" >> ${OPTIONS_CONF} fi # Which version of php.ini to install? if [ "${INPUT_VALUE}" = "d" ]; then wantphpini=no else echo -n "Do you want to have the php.ini (PHP configuration file) rewritten? (yes/no): "; read wantphpini; fi until [ "${wantphpini}" = "yes" ] || [ "${wantphpini}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read wantphpini done if [ "${wantphpini}" = "yes" ]; then echo -n "For the next question, the usual file is the dist (distribution) version."; echo -n "What type of php.ini (PHP configuration file) do you want to have? (dist/recommended): "; read phpinitype; until [ "${phpinitype}" = "dist" ] || [ "${phpinitype}" = "recommended" ]; do echo -n "Please enter 'dist' or 'recommended':" read phpinitype; done echo "php_ini=yes" >> ${OPTIONS_CONF} echo "#Possible values - recommended or dist" >> ${OPTIONS_CONF} echo "php_ini_type=${phpinitype}" >> ${OPTIONS_CONF} elif [ "${wantphpini}" = "no" ]; then echo "php_ini=no" >> ${OPTIONS_CONF} echo "#Possible values - recommended or dist" >> ${OPTIONS_CONF} echo "php_ini_type=recommended" >> ${OPTIONS_CONF} fi # Install Zend Optimizer or not? if [ "${INPUT_VALUE}" = "d" ]; then installzend=no else echo -n "Do you want to have Zend Optimizer? (yes/no): "; read installzend; fi until [ "${installzend}" = "yes" ] || [ "${installzend}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read installzend; done echo "zend=${installzend}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install MySQL or not? if [ "${INPUT_VALUE}" = "d" ]; then installmysql=no else echo -n "Do you want to be able to update/instal MySQL using CustomBuild? (yes/no): "; read installmysql; fi until [ "${installmysql}" = "yes" ] || [ "${installmysql}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read installmysql; done if [ "${installmysql}" = "yes" ]; then echo -n "Which version of MySQL do you want to have? (4.1/5.0/5.1): "; read mysqlvers; until [ "${mysqlvers}" = "4.1" ] || [ "${mysqlvers}" = "5.0" ] || [ "${mysqlvers}" = "5.1" ]; do echo -n "Please enter '4.1', '5.0' or '5.1': " read mysqlvers; done echo "#Possible values - 5.0 or 5.1 (4.1 is possible too, but it's EOL)" >> ${OPTIONS_CONF} echo "mysql=${mysqlvers}" >> ${OPTIONS_CONF} echo "mysql_inst=yes" >> ${OPTIONS_CONF} elif [ "${installmysql}" = "no" ]; then echo "#Possible values - 5.0 or 5.1 (4.1 is possible too, but it's EOL)" >> ${OPTIONS_CONF} echo "mysql=5.0" >> ${OPTIONS_CONF} echo "mysql_inst=no" >> ${OPTIONS_CONF} fi # Backup MySQL or not? if [ "${INPUT_VALUE}" = "d" ]; then mysqlback=no else echo -n "Do you want CustomBuild to backup MySQL databases before the update? (yes/no): "; read mysqlback; fi until [ "${mysqlback}" = "yes" ] || [ "${mysqlback}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read mysqlback; done echo "mysql_backup=${mysqlback}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Which version of Apache to use? if [ "${INPUT_VALUE}" = "d" ]; then apachever=2.2 else echo -n "Which version of Apache do you want to have? (1.3/2.0/2.2): "; read apachever; fi until [ "${apachever}" = "1.3" ] || [ "${apachever}" = "2.0" ] || [ "${apachever}" = "2.2" ]; do echo -n "Please enter '1.3', '2.0' or '2.2': " read apachever; done echo "#Possible values - 1.3, 2.0 or 2.2" >> ${OPTIONS_CONF} echo "apache_ver=${apachever}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install phpMyAdmin or not? if [ "${INPUT_VALUE}" = "d" ]; then phpmyadmin=yes else echo -n "Do you want to be able to install/update phpMyAdmin using CustomBuild? (yes/no): "; read phpmyadmin; fi until [ "${phpmyadmin}" = "yes" ] || [ "${phpmyadmin}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read phpmyadmin; done echo "#Web applications" >> ${OPTIONS_CONF} echo "phpmyadmin=${phpmyadmin}" >> ${OPTIONS_CONF} # Install Atmail or not? if [ "${INPUT_VALUE}" = "d" ]; then atmail=yes else echo -n "Do you want to be able to install/update Atmail webmail using CustomBuild? (yes/no): "; read atmail; fi until [ "${atmail}" = "yes" ] || [ "${atmail}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read atmail; done echo "atmail=${atmail}" >> ${OPTIONS_CONF} # Install SquirrelMail or not? if [ "${INPUT_VALUE}" = "d" ]; then squirrelmail=yes else echo -n "Do you want to be able to install/update SquirrelMail webmail using CustomBuild? (yes/no): "; read squirrelmail; fi until [ "${squirrelmail}" = "yes" ] || [ "${squirrelmail}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read squirrelmail; done echo "squirrelmail=${squirrelmail}" >> ${OPTIONS_CONF} # Install RoundCube or not? if [ "${INPUT_VALUE}" = "d" ]; then roundcube=yes else echo -n "Do you want to be able to install/update RoundCube webmail using CustomBuild? (yes/no): "; read roundcube; fi until [ "${roundcube}" = "yes" ] || [ "${roundcube}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read roundcube; done echo "roundcube=${roundcube}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install UebiMiau or not? if [ "${INPUT_VALUE}" = "d" ]; then uebimiau=no else echo -n "Do you want to be able to install/update UebiMiau webmail using CustomBuild? (yes/no): "; read uebimiau; fi until [ "${uebimiau}" = "yes" ] || [ "${uebimiau}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read uebimiau; done echo "uebimiau=${uebimiau}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install PHP mail() header patch or not? if [ "${INPUT_VALUE}" = "d" ]; then mailheaderpatch=yes else echo -n "Do you want to install PHP mail() header patch together with PHP? (yes/no): "; read mailheaderpatch; fi until [ "${mailheaderpatch}" = "yes" ] || [ "${mailheaderpatch}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read mailheaderpatch; done echo "#Mail options" >> ${OPTIONS_CONF} echo "mail-header-patch=${mailheaderpatch}" >> ${OPTIONS_CONF} # Install Dovecot or not? if [ "${INPUT_VALUE}" = "d" ]; then dovecot=yes else echo -n "Do you want to install Dovecot? (yes/no): "; read dovecot; fi until [ "${dovecot}" = "yes" ] || [ "${dovecot}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read dovecot; done echo "dovecot=${dovecot}" >> ${OPTIONS_CONF} # Update exim.conf or not? if [ "${INPUT_VALUE}" = "d" ]; then exim=yes else echo -n "Do you want to be able to install/update Exim using CustomBuild? (yes/no): "; read eximconf; fi until [ "${eximconf}" = "yes" ] || [ "${eximconf}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read eximconf; done echo "eximconf=${eximconf}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Update exim.conf or not? if [ "${INPUT_VALUE}" = "d" ]; then eximconf=yes else echo -n "Do you want to be able to update Exim configuration file (exim.conf) using CustomBuild? (yes/no): "; read eximconf; fi until [ "${eximconf}" = "yes" ] || [ "${eximconf}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read eximconf; done echo "eximconf=${eximconf}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install jailed shell or not? if [ "${INPUT_VALUE}" = "d" ]; then jail=no else echo -n "Do you want CustomBuild to install Jailed shell (beta)? (yes/no): "; read jail; fi until [ "${jail}" = "yes" ] || [ "${jail}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read jail; done echo "#Jailed shell" >> ${OPTIONS_CONF} echo "jail=${jail}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Install proftpd or not? if [ "${INPUT_VALUE}" = "d" ]; then proftpd=yes else echo -n "Do you want to be able to install/update ProFTPD using CustomBuild? (yes/no): "; read proftpd; fi until [ "${proftpd}" = "yes" ] || [ "${proftpd}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read proftpd; done echo "#FTP options" >> ${OPTIONS_CONF} echo "proftpd=${proftpd}" >> ${OPTIONS_CONF} echo "" >> ${OPTIONS_CONF} # Download versions.txt automatically? if [ "${INPUT_VALUE}" = "d" ]; then autover=no else echo -n "Do you want CustomBuild to download versions.txt every time? (yes/no): "; read autover; fi until [ "${autover}" = "yes" ] || [ "${autover}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read autover; done echo "#Custombuild options" >> ${OPTIONS_CONF} echo "autover=${autover}" >> ${OPTIONS_CONF} # Bold on or off? if [ "${INPUT_VALUE}" = "d" ]; then bold=yes else echo -n "Do you want to enable bolded text? (yes/no): "; read bold; fi until [ "${bold}" = "yes" ] || [ "${bold}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read bold; done echo "bold=${bold}" >> ${OPTIONS_CONF} # Clean every time or not? if [ "${INPUT_VALUE}" = "d" ]; then clean=yes else echo -n "Do you want to clean everything (run './build clean' every time) running CustomBuild? (yes/no): "; read clean; fi until [ "${clean}" = "yes" ] || [ "${clean}" = "no" ]; do echo -n "Please enter 'yes' or 'no': " read clean; done echo "clean=${clean}" >> ${OPTIONS_CONF} # Which fileserver to use? #if [ "${INPUT_VALUE}" = "d" ]; then # fileserver=1 #else # echo -n "Which fileserver do you want to use (1 is located in USA, 2 - Europe)? (1/2): "; # read fileserver; #fi #until [ "${fileserver}" = "1" ] || [ "${fileserver}" = "2" ]; do # echo -n "Please enter '1' or '2': " # read fileserver; #done #echo "fileserver=${fileserver}" >> ${OPTIONS_CONF} echo "run ./build set_fastest to select the quickest mirror"; echo "custombuild=${CUSTOMBUILD_OPT}" >> ${OPTIONS_CONF} echo "cleanapache=no" >> ${OPTIONS_CONF} echo "clean_old_tarballs=no" >> ${OPTIONS_CONF} echo "Options.conf has been installed successfully"