diff --git a/bin/installfog.sh b/bin/installfog.sh index aa7a8197c6..d4b8270d0c 100755 --- a/bin/installfog.sh +++ b/bin/installfog.sh @@ -24,12 +24,12 @@ if [[ ! $EUID -eq 0 ]]; then exit 1 fi which useradd >/dev/null 2>&1 -if [[ $? -eq 1 || $(echo $PATH | grep -o "sbin" | wc -l) -lt 2 ]]; then - echo "Please switch to a proper root environment to run the installer!" - echo "Use 'sudo -i' or 'su -' (skip the ' and note the hyphen at the end" - echo "of the su command as it is important to load root's environment)." - exit 1 -fi +#if [[ $? -eq 1 || $(echo $PATH | grep -o "sbin" | wc -l) -lt 2 ]]; then +# echo "Please switch to a proper root environment to run the installer!" +# echo "Use 'sudo -i' or 'su -' (skip the ' and note the hyphen at the end" +# echo "of the su command as it is important to load root's environment)." +# exit 1 +#fi timestamp=$(date +%s) backupconfig="" . ../lib/common/functions.sh diff --git a/lib/arch/config.sh b/lib/arch/config.sh index e4ba25200c..d57a2b9cac 100644 --- a/lib/arch/config.sh +++ b/lib/arch/config.sh @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -[[ -z $packages ]] && packages="apache bc cdrtools curl dhcp gcc git gzip lftp m4 make mariadb mod_fastcgi net-tools nfs-utils openssh openssl perl perl-crypt-passwdmd5 php php-apache php-fpm php-gd syslinux tar tftp-hpa vsftpd wget xinetd xz" + +[[ -z $packages ]] && packages="apache bc cdrtools curl dhcp gcc git gzip lftp m4 make mariadb fcgi net-tools nfs-utils openssh openssl perl perl-crypt-passwdmd5 php7 php7-apache php7-fpm php7-gd syslinux tar tftp-hpa vsftpd wget xinetd xz" [[ -z $packageinstaller ]] && packageinstaller="pacman -Sy --noconfirm" [[ -z $packagelist ]] && packagelist="pacman -Si" [[ -z $packageupdater ]] && packageupdater="pacman -Syu --noconfirm" @@ -38,7 +39,7 @@ fi [[ -z $apacheacclog ]] && apacheacclog="$apachelogdir/access_log" [[ -z $httpdconf ]] && httpdconf="/etc/httpd/conf/httpd.conf" [[ -z $etcconf ]] && etcconf="/etc/httpd/conf/extra/fog.conf" -[[ -z $phpini ]] && phpini="/etc/php/php.ini" +[[ -z $phpini ]] && phpini="/etc/php7/php.ini" [[ -z $storageLocation ]] && storageLocation="/images" [[ -z $storageLocationCapture ]] && storageLocationCapture="${storageLocation}/dev" [[ -z $dhcpconfig ]] && dhcpconfig="/etc/dhcpd.conf" diff --git a/lib/common/functions.sh b/lib/common/functions.sh index bc3ec59591..7c4ccf6ee5 100755 --- a/lib/common/functions.sh +++ b/lib/common/functions.sh @@ -554,7 +554,7 @@ configureTFTPandPXE() { sleep 2 systemctl status xinetd >>$workingdir/error_logs/fog_error_${version}.log 2>&1 fi - ;; + ;; *) if [[ $osid -eq 2 && -f $tftpconfigupstartdefaults ]]; then echo -e "# /etc/default/tftpd-hpa\n# FOG Modified version\nTFTP_USERNAME=\"root\"\nTFTP_DIRECTORY=\"/tftpboot\"\nTFTP_ADDRESS=\":69\"\nTFTP_OPTIONS=\"-s\"" > "$tftpconfigupstartdefaults" @@ -571,6 +571,9 @@ configureTFTPandPXE() { sleep 2 $initdpath/xinetd start >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 + elif [[ $osid -eq 3 ]]; then + systemctl stop xinetd >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + systemctl disable xinetd >>$workingdir/error_logs/fog_error_${version}.log 2>&1 else chkconfig xinetd on >>$workingdir/error_logs/fog_error_${version}.log 2>&1 service xinetd stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 @@ -1970,7 +1973,7 @@ EOF fi ;; 3) - phpfpmconf='/etc/php/php-fpm.d/www.conf' + phpfpmconf='/etc/php7/php-fpm.d/www.conf' ;; esac if [[ -n $phpfpmconf ]]; then @@ -2004,11 +2007,11 @@ EOF systemctl status apache2 $phpfpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 ;; *) - systemctl stop httpd php-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + systemctl stop httpd php-fpm7 >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 - systemctl start httpd php-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + systemctl start httpd php-fpm7 >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 - systemctl status httpd php-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + systemctl status httpd php-fpm7 >>$workingdir/error_logs/fog_error_${version}.log 2>&1 ;; esac ;; @@ -2031,12 +2034,12 @@ EOF sleep 2 service httpd start >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 - service php-fpm stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + service php-fpm7 stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 - service php-fpm start >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + service php-fpm7 start >>$workingdir/error_logs/fog_error_${version}.log 2>&1 sleep 2 service httpd status >>$workingdir/error_logs/fog_error_${version}.log 2>&1 - service php-fpm status >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + service php-fpm7 status >>$workingdir/error_logs/fog_error_${version}.log 2>&1 ;; esac ;; @@ -2050,7 +2053,7 @@ configureHttpd() { yes) case $osid in 1|3) - systemctl stop httpd php-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 + systemctl stop httpd php-fpm7 >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 ;; 2) systemctl stop apache2 php${php_ver}-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 @@ -2062,7 +2065,7 @@ configureHttpd() { case $osid in 1) service httpd stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 - service php-fpm stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 + service php-fpm7 stop >>$workingdir/error_logs/fog_error_${version}.log 2>&1 && sleep 2 errorStat $? ;; 2) @@ -2336,9 +2339,9 @@ die(); sysv-rc-conf $phpfpm on >>$workingdir/error_logs/fog_error_${version}.log 2>&1 fi elif [[ $systemctl == yes ]]; then - systemctl enable httpd php-fpm >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + systemctl enable httpd php-fpm7 >>$workingdir/error_logs/fog_error_${version}.log 2>&1 else - chkconfig php-fpm on >>$workingdir/error_logs/fog_error_${version}.log 2>&1 + chkconfig php-fpm7 on >>$workingdir/error_logs/fog_error_${version}.log 2>&1 chkconfig httpd on >>$workingdir/error_logs/fog_error_${version}.log 2>&1 fi errorStat $?