#!/bin/bash PACKAGE="php-installer_8.2.18.tar.xz"; SUM="ef95711a9f4bf1a6f1ecd2f88be3c7004118403839e2be971235482002ac0df3"; WORKDIR=${PWD}; check_package() { if [[ ! -e $WORKDIR/$PACKAGE ]]; then echo -e "\033[32mDownloading file...\033[0m"; curl -sS --connect-timeout 30 -O https://people.ipfire.org/~mlorenz/php/${PACKAGE}; echo -e "\033[32mFile download success...\033[0m"; else echo "$PACKAGE local found..."; fi; echo -e "\033[1;36mCheck the SHA256 sum now...\033[0m"; CHECK=$(sha256sum "$WORKDIR/${PACKAGE}"| awk '{print $1}'); if [[ "${SUM}" = "${CHECK}" ]]; then echo "Check SHA256 sum of file: ${PACKAGE}"; echo -e "SHA256 sum is \033[32m${CHECK}\033[0m \033[92mOK\033[0m "; echo "SHA256 sum is correct! Continuing installer..."; echo " "; else echo -e "SHA256 sum should be \033[92m${CHECK}\033[0m"; echo -e "SHA256 sum is \033[91m${SUM}\033[0m and is not correct\033[0m "; echo -e "\033[1;31mShit happens :-( the SHA256 sum is incorrect, please report this here\033[0m"; echo; exit 1; fi; echo -en "\033[32mUnpack files now...\033[0m"; tar xf $WORKDIR/${PACKAGE}; rm -f $WORKDIR/${PACKAGE}; unset SUM PACKAGE CHECK; echo -e "\033[92mdone...\033[0m"; } clear; echo -e "\033[1;36m--------------------------------------------------------------------------------\033[0m"; echo -e "\033[1;36m- This is the PHP and Perl installer for IPfire -\033[0m"; echo -e "\033[1;36m--------------------------------------------------------------------------------\033[0m"; echo " "; PLATFORM=$(uname -m); if [[ $PLATFORM == armv5tel || $PLATFORM == armv5tejl || $PLATFORM == armv6l || $PLATFORM == armv7l ]]; then echo -e "\033[91mInstallation only on Intel platforms. ARM based systems are not supported!\033[0m"; unset PLATFORM; exit 0; fi; check_package; if [[ -e $WORKDIR/phpinstall.sh ]]; then chmod +x $WORKDIR/phpinstall.sh echo -e "\033[32mStarting installer now...\033[0m"; $WORKDIR/phpinstall.sh |tee ${WORKDIR}/phpinstall.log; rm -f $WORKDIR/php_installer* ${WORKDIR}/phpinstall.sh; else echo "phpinstall.sh not found! quit installer!" fi; unset WORKDIR; exit 0; #End of start.sh