"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/common/functions.sh" between
fogproject-1.5.6.tar.gz and fogproject-1.5.7.tar.gz

About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn\PKG_DESCR_TTrsquo;t use any boot disks, or CDs; everything is done via TFTP and PXE.

functions.sh  (fogproject-1.5.6):functions.sh  (fogproject-1.5.7)
skipping to change at line 432 skipping to change at line 432
} }
configureTFTPandPXE() { configureTFTPandPXE() {
[[ -d ${tftpdirdst}.prev ]] && rm -rf ${tftpdirdst}.prev >>$workingdir/error _logs/fog_error_${version}.log 2>&1 [[ -d ${tftpdirdst}.prev ]] && rm -rf ${tftpdirdst}.prev >>$workingdir/error _logs/fog_error_${version}.log 2>&1
[[ ! -d ${tftpdirdst} ]] && mkdir -p $tftpdirdst >>$workingdir/error_logs/fo g_error_${version}.log 2>&1 [[ ! -d ${tftpdirdst} ]] && mkdir -p $tftpdirdst >>$workingdir/error_logs/fo g_error_${version}.log 2>&1
[[ -e ${tftpdirdst}.fogbackup ]] && rm -rf ${tftpdirdst}.fogbackup >>$workin gdir/error_logs/fog_error_${version}.log 2>&1 [[ -e ${tftpdirdst}.fogbackup ]] && rm -rf ${tftpdirdst}.fogbackup >>$workin gdir/error_logs/fog_error_${version}.log 2>&1
[[ -d $tftpdirdst && ! -d ${tftpdirdst}.prev ]] && mkdir -p ${tftpdirdst}.pr ev >>$workingdir/error_logs/fog_error_${version}.log 2>&1 [[ -d $tftpdirdst && ! -d ${tftpdirdst}.prev ]] && mkdir -p ${tftpdirdst}.pr ev >>$workingdir/error_logs/fog_error_${version}.log 2>&1
[[ -d ${tftpdirdst}.prev ]] && cp -Rf $tftpdirdst/* ${tftpdirdst}.prev/ >>$w orkingdir/error_logs/fog_error_${version}.log 2>&1 [[ -d ${tftpdirdst}.prev ]] && cp -Rf $tftpdirdst/* ${tftpdirdst}.prev/ >>$w orkingdir/error_logs/fog_error_${version}.log 2>&1
if [[ "x$httpproto" = "xhttps" ]]; then if [[ "x$httpproto" = "xhttps" ]]; then
dots "Compiling iPXE binaries that trust our SSL certificate" dots "Compiling iPXE binaries that trust our SSL certificate"
cd $buildipxesrc cd $buildipxesrc
./buildipxe.sh $sslpath/CA/.fogCA.pem >>$workingdir/error_logs/fog_error _${version}.log 2>&1 ./buildipxe.sh ${sslpath}CA/.fogCA.pem >>$workingdir/error_logs/fog_erro r_${version}.log 2>&1
errorStat $? errorStat $?
cd $workingdir cd $workingdir
fi fi
dots "Setting up and starting TFTP and PXE Servers" dots "Setting up and starting TFTP and PXE Servers"
cd $tftpdirsrc cd $tftpdirsrc
for tftpdir in $(ls -d */); do for tftpdir in $(ls -d */); do
[[ ! -d $tftpdirdst/$tftpdir ]] && mkdir -p $tftpdirdst/$tftpdir >>$work ingdir/error_logs/fog_error_${version}.log 2>&1 [[ ! -d $tftpdirdst/$tftpdir ]] && mkdir -p $tftpdirdst/$tftpdir >>$work ingdir/error_logs/fog_error_${version}.log 2>&1
done done
local findoptions="" local findoptions=""
[[ $notpxedefaultfile == true ]] && findoptions="! -name default" [[ $notpxedefaultfile == true ]] && findoptions="! -name default"
skipping to change at line 601 skipping to change at line 601
;; ;;
2) 2)
packages="${packages// libapache2-mod-fastcgi/}" packages="${packages// libapache2-mod-fastcgi/}"
packages="${packages// libapache2-mod-evasive/}" packages="${packages// libapache2-mod-evasive/}"
packages="${packages// php${php_ver}-mcrypt/}" packages="${packages// php${php_ver}-mcrypt/}"
packages="${packages} php${php_ver}-bcmath bc" packages="${packages} php${php_ver}-bcmath bc"
case $linuxReleaseName in case $linuxReleaseName in
*[Uu][Bb][Uu][Nn][Tt][Uu]*|*[Mm][Ii][Nn][Tt]*) *[Uu][Bb][Uu][Nn][Tt][Uu]*|*[Mm][Ii][Nn][Tt]*)
addUbuntuRepo addUbuntuRepo
;; ;;
*[Dd][Ee][Bb][Ii][Aa][Nn]*)
if [[ $OSVersion -ge 10 ]]; then
packages="${packages// libcurl3 / libcurl4 }">>$workingd
ir/error_logs/fog_error_${version}.log 2>&1
packages="${packages// mysql / mariadb }">>$workingdir/e
rror_logs/fog_error_${version}.log 2>&1
packages="${packages// mysql-server / mariadb-server }">
>$workingdir/error_logs/fog_error_${version}.log 2>&1
fi
;;
esac esac
;; ;;
3) 3)
echo $packages | grep -q -v " git" && packages="${packages} git" echo $packages | grep -q -v " git" && packages="${packages} git"
packages="${packages// php-mcrypt/}" packages="${packages// php-mcrypt/}"
;; ;;
esac esac
errorStat $? errorStat $?
dots "Preparing Package Manager" dots "Preparing Package Manager"
$packmanUpdate >>$workingdir/error_logs/fog_error_${version}.log 2>&1 $packmanUpdate >>$workingdir/error_logs/fog_error_${version}.log 2>&1
skipping to change at line 1203 skipping to change at line 1211
echo "# If you this move/delete was unintentional you can run: #" echo "# If you this move/delete was unintentional you can run: #"
echo " userdel $username" echo " userdel $username"
echo " useradd -s \"/bin/bash\" -d \"/home/$username\" -m \"$username\"" echo " useradd -s \"/bin/bash\" -d \"/home/$username\" -m \"$username\""
#userdel $username #userdel $username
#useradd -s "/bin/bash" -d "/home/${username}" -m ${username} >>$working dir/error_logs/fog_error_${version}.log 2>&1 #useradd -s "/bin/bash" -d "/home/${username}" -m ${username} >>$working dir/error_logs/fog_error_${version}.log 2>&1
#errorStat $? #errorStat $?
fi fi
dots "Locking $username as a system account" dots "Locking $username as a system account"
chsh -s /bin/bash $username >>$workingdir/error_logs/fog_error_${version}.lo g 2>&1 chsh -s /bin/bash $username >>$workingdir/error_logs/fog_error_${version}.lo g 2>&1
textmessage="You seem to be using the '$username' system account to logon an d work \non your FOG server system.\n\nIt's NOT recommended to use this account! Please create a new \naccount for administrative tasks.\n\nIf you re-run the in staller it would reset the 'fog' account \npassword and therefore lock you out o f the system!\n\nTake care, \nyour FOGproject team" textmessage="You seem to be using the '$username' system account to logon an d work \non your FOG server system.\n\nIt's NOT recommended to use this account! Please create a new \naccount for administrative tasks.\n\nIf you re-run the in staller it would reset the 'fog' account \npassword and therefore lock you out o f the system!\n\nTake care, \nyour FOGproject team"
grep "exit 1" /home/$username/.bashrc || cat >>/home/$username/.bashrc <<EOF grep -q "exit 1" /home/$username/.bashrc || cat >>/home/$username/.bashrc << EOF
echo -e "$textmessage" echo -e "$textmessage"
exit 1 exit 1
EOF EOF
mkdir -p /home/$username/.config/autostart/ mkdir -p /home/$username/.config/autostart/
cat >/home/$username/.config/autostart/warnfogaccount.desktop <<EOF cat >/home/$username/.config/autostart/warnfogaccount.desktop <<EOF
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=Warn users to not use the $username account Name=Warn users to not use the $username account
Exec=/home/$username/warnfogaccount.sh Exec=/home/$username/warnfogaccount.sh
skipping to change at line 2075 skipping to change at line 2083
private static function _initSetting() private static function _initSetting()
{ {
define('TFTP_HOST', \"${ipaddress}\"); define('TFTP_HOST', \"${ipaddress}\");
define('TFTP_FTP_USERNAME', \"${username}\"); define('TFTP_FTP_USERNAME', \"${username}\");
define( define(
'TFTP_FTP_PASSWORD', 'TFTP_FTP_PASSWORD',
\"${password}\" \"${password}\"
); );
define('TFTP_PXE_KERNEL_DIR', \"${webdirdest}/service/ipxe/\"); define('TFTP_PXE_KERNEL_DIR', \"${webdirdest}/service/ipxe/\");
define('PXE_KERNEL', 'bzImage'); define('PXE_KERNEL', 'bzImage');
define('PXE_KERNEL_RAMDISK', 127000); define('PXE_KERNEL_RAMDISK', 275000);
define('USE_SLOPPY_NAME_LOOKUPS', true); define('USE_SLOPPY_NAME_LOOKUPS', true);
define('MEMTEST_KERNEL', 'memtest.bin'); define('MEMTEST_KERNEL', 'memtest.bin');
define('PXE_IMAGE', 'init.xz'); define('PXE_IMAGE', 'init.xz');
define('STORAGE_HOST', \"${ipaddress}\"); define('STORAGE_HOST', \"${ipaddress}\");
define('STORAGE_FTP_USERNAME', \"${username}\"); define('STORAGE_FTP_USERNAME', \"${username}\");
define( define(
'STORAGE_FTP_PASSWORD', 'STORAGE_FTP_PASSWORD',
\"${password}\" \"${password}\"
); );
define('STORAGE_DATADIR', '${storageLocation}/'); define('STORAGE_DATADIR', '${storageLocation}/');
skipping to change at line 2173 skipping to change at line 2181
for url in "${urls[@]}" for url in "${urls[@]}"
do do
checksum=1 checksum=1
cnt=0 cnt=0
filename=$(basename -- "$url") filename=$(basename -- "$url")
hashfile="${filename}.sha256" hashfile="${filename}.sha256"
baseurl=$(dirname -- "$url") baseurl=$(dirname -- "$url")
hashurl="${baseurl}/${hashfile}" hashurl="${baseurl}/${hashfile}"
while [[ $checksum -ne 0 && $cnt -lt 10 ]] while [[ $checksum -ne 0 && $cnt -lt 10 ]]
do do
sha256sum --check $hashfile >>$workingdir/error_logs/fog_error_${ver sion}.log 2>&1 [[ -f $hashfile ]] && sha256sum --check $hashfile >>$workingdir/erro r_logs/fog_error_${version}.log 2>&1
checksum=$? checksum=$?
if [[ $checksum -ne 0 ]] if [[ $checksum -ne 0 ]]
then then
curl --silent -kOL $url >>$workingdir/error_logs/fog_error_${ver sion}.log 2>&1 curl --silent -kOL $url >>$workingdir/error_logs/fog_error_${ver sion}.log 2>&1
curl --silent -kOL $hashurl >>$workingdir/error_logs/fog_error_$ {version}.log 2>&1 curl --silent -kOL $hashurl >>$workingdir/error_logs/fog_error_$ {version}.log 2>&1
fi fi
let cnt+=1 let cnt+=1
done done
if [[ $checksum -ne 0 ]] if [[ $checksum -ne 0 ]]
then then
 End of changes. 5 change blocks. 
4 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)