Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch Linux Patches #492

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bin/installfog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lib/arch/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
[[ -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"
Expand All @@ -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"
Expand Down
27 changes: 15 additions & 12 deletions lib/common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
Expand All @@ -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
;;
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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 $?
Expand Down