"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bin/installfog.sh" between
fogproject-1.5.5.tar.gz and fogproject-1.5.6.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’t use any boot disks, or CDs; everything is done via TFTP and PXE.

installfog.sh  (fogproject-1.5.5):installfog.sh  (fogproject-1.5.6)
skipping to change at line 19 skipping to change at line 19
# any later version. # any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
bindir=$(dirname $(readlink -f "$BASH_SOURCE") )
cd $bindir
workingdir=$(pwd) workingdir=$(pwd)
if [[ ! $EUID -eq 0 ]]; then if [[ ! $EUID -eq 0 ]]; then
exec sudo $0 $@ || echo "FOG Installation must be run as root user" exec sudo $0 $@ || echo "FOG Installation must be run as root user"
exit 1 # Fail Sudo exit 1 # Fail Sudo
fi fi
. ../lib/common/functions.sh . ../lib/common/functions.sh
help() { help() {
echo -e "Usage: $0 [-h?dEUuHSCKYXT] [-f <filename>]" echo -e "Usage: $0 [-h?dEUuHSCKYXT] [-f <filename>]"
echo -e "\t\t[-D </directory/to/document/root/>] [-c <sslPath>]" echo -e "\t\t[-D </directory/to/document/root/>] [-c <ssl-path>]"
echo -e "\t\t[-W <webroot/to/fog/after/docroot/>] [-B </backup/path/>]" echo -e "\t\t[-W <webroot/to/fog/after/docroot/>] [-B </backup/path/>]"
echo -e "\t\t[-s <192.168.1.10>] [-e <192.168.1.254>] [-b <undionly.kpxe>]" echo -e "\t\t[-s <192.168.1.10>] [-e <192.168.1.254>] [-b <undionly.kpxe>]"
echo -e "\t-h -? --help\t\t\tDisplay this info" echo -e "\t-h -? --help\t\t\tDisplay this info"
echo -e "\t-o --oldcopy\t\t\tCopy back old data" echo -e "\t-o --oldcopy\t\t\tCopy back old data"
echo -e "\t-d --no-defaults\t\tDon't guess defaults" echo -e "\t-d --no-defaults\t\tDon't guess defaults"
echo -e "\t-U --no-upgrade\t\tDon't attempt to upgrade" echo -e "\t-U --no-upgrade\t\tDon't attempt to upgrade"
echo -e "\t-H --no-htmldoc\t\tNo htmldoc, means no PDFs" echo -e "\t-H --no-htmldoc\t\tNo htmldoc, means no PDFs"
echo -e "\t-S --force-https\t\tForce HTTPS for all comunication" echo -e "\t-S --force-https\t\tForce HTTPS for all comunication"
echo -e "\t-C --recreate-CA\t\tRecreate the CA Keys" echo -e "\t-C --recreate-CA\t\tRecreate the CA Keys"
echo -e "\t-K --recreate-keys\t\tRecreate the SSL Keys" echo -e "\t-K --recreate-keys\t\tRecreate the SSL Keys"
echo -e "\t-Y -y --autoaccept\t\tAuto accept defaults and install" echo -e "\t-Y -y --autoaccept\t\tAuto accept defaults and install"
echo -e "\t-f --file\t\t\tUse different update file" echo -e "\t-f --file\t\t\tUse different update file"
echo -e "\t-c --ssl-file\t\tSpecify the ssl path" echo -e "\t-c --ssl-path\t\tSpecify the ssl path"
echo -e "\t \t\t\t\tdefaults to /opt/fog/snapins/ssl" echo -e "\t \t\t\t\tdefaults to /opt/fog/snapins/ssl"
echo -e "\t-D --docroot\t\t\tSpecify the Apache Docroot for fog" echo -e "\t-D --docroot\t\t\tSpecify the Apache Docroot for fog"
echo -e "\t \t\t\t\tdefaults to OS DocumentRoot" echo -e "\t \t\t\t\tdefaults to OS DocumentRoot"
echo -e "\t-W --webroot\t\t\tSpecify the web root url want fog to use" echo -e "\t-W --webroot\t\t\tSpecify the web root url want fog to use"
echo -e "\t \t\t\t\t(E.G. http://127.0.0.1/fog," echo -e "\t \t\t\t\t(E.G. http://127.0.0.1/fog,"
echo -e "\t \t\t\t\t http://127.0.0.1/)" echo -e "\t \t\t\t\t http://127.0.0.1/)"
echo -e "\t \t\t\t\tDefaults to /fog/" echo -e "\t \t\t\t\tDefaults to /fog/"
echo -e "\t-B --backuppath\t\tSpecify the backup path" echo -e "\t-B --backuppath\t\tSpecify the backup path"
echo -e "\t --uninstall\t\tUninstall FOG" echo -e "\t --uninstall\t\tUninstall FOG"
echo -e "\t-s --startrange\t\tDHCP Start range" echo -e "\t-s --startrange\t\tDHCP Start range"
skipping to change at line 74 skipping to change at line 76
case $OPTARG in case $OPTARG in
help) help)
help help
exit 0 exit 0
;; ;;
uninstall) uninstall)
exit 0 exit 0
;; ;;
ssl-path) ssl-path)
ssslpath="${OPTARG}" ssslpath="${OPTARG}"
ssslpath="${sslpath#'/'}" ssslpath="${ssslpath#'/'}"
ssslpath="${sslpath%'/'}" ssslpath="${ssslpath%'/'}"
sslpath="/${sslpath}/" ssslpath="/${ssslpath}/"
;; ;;
no-vhost) no-vhost)
novhost="y" novhost="y"
;; ;;
no-defaults) no-defaults)
guessdefaults=0 guessdefaults=0
;; ;;
no-upgrade) no-upgrade)
doupdate=0 doupdate=0
;; ;;
skipping to change at line 146 skipping to change at line 148
fi fi
sbackupPath=$OPTARG sbackupPath=$OPTARG
;; ;;
startrange) startrange)
if [[ $(validip $OPTARG) != 0 ]]; then if [[ $(validip $OPTARG) != 0 ]]; then
echo "Invalid ip passed" echo "Invalid ip passed"
help help
exit 5 exit 5
fi fi
sstartrange=$OPTARG sstartrange=$OPTARG
dodhcp="Y"
bldhcp=1
;; ;;
endrange) endrange)
if [[ $(validip $OPTARG) != 0 ]]; then if [[ $(validip $OPTARG) != 0 ]]; then
echo "Invalid ip passed" echo "Invalid ip passed"
help help
exit 6 exit 6
fi fi
sendrange=$OPTARG sendrange=$OPTARG
dodhcp="Y"
bldhcp=1
;; ;;
bootfile) bootfile)
sbootfilename=$OPTARG sbootfilename=$OPTARG
;; ;;
no-exportbuild) no-exportbuild)
sblexports=0 sblexports=0
;; ;;
exitFail) exitFail)
sexitFail=1 sexitFail=1
;; ;;
skipping to change at line 188 skipping to change at line 194
;; ;;
h|'?') h|'?')
help help
exit 0 exit 0
;; ;;
o) o)
scopybackold=1 scopybackold=1
;; ;;
c) c)
ssslpath="${OPTARG}" ssslpath="${OPTARG}"
ssslpath="${sslpath#'/'}" ssslpath="${ssslpath#'/'}"
ssslpath="${sslpath%'/'}" ssslpath="${ssslpath%'/'}"
ssslpath="/${sslpath}/" ssslpath="/${ssslpath}/"
;; ;;
d) d)
guessdefaults=0 guessdefaults=0
;; ;;
U) U)
doupdate=0 doupdate=0
;; ;;
H) H)
signorehtmldoc=1 signorehtmldoc=1
;; ;;
skipping to change at line 256 skipping to change at line 262
fi fi
sbackupPath=$OPTARG sbackupPath=$OPTARG
;; ;;
s) s)
if [[ $(validip $OPTARG) != 0 ]]; then if [[ $(validip $OPTARG) != 0 ]]; then
echo "Invalid ip passed" echo "Invalid ip passed"
help help
exit 5 exit 5
fi fi
sstartrange=$OPTARG sstartrange=$OPTARG
dodhcp="Y"
bldhcp=1
;; ;;
e) e)
if [[ $(validip $OPTARG) != 0 ]]; then if [[ $(validip $OPTARG) != 0 ]]; then
echo "Invalid ip passed" echo "Invalid ip passed"
help help
exit 6 exit 6
fi fi
sendrange=$OPTARG sendrange=$OPTARG
dodhcp="Y"
bldhcp=1
;; ;;
b) b)
sbootfilename=$OPTARG sbootfilename=$OPTARG
;; ;;
E) E)
sblexports=0 sblexports=0
;; ;;
X) X)
exitFail=1 exitFail=1
;; ;;
skipping to change at line 349 skipping to change at line 359
echo "Done" echo "Done"
. ../lib/common/config.sh . ../lib/common/config.sh
[[ -z $dnsaddress ]] && dnsaddress="" [[ -z $dnsaddress ]] && dnsaddress=""
[[ -z $username ]] && username="" [[ -z $username ]] && username=""
[[ -z $password ]] && password="" [[ -z $password ]] && password=""
[[ -z $osid ]] && osid="" [[ -z $osid ]] && osid=""
[[ -z $osname ]] && osname="" [[ -z $osname ]] && osname=""
[[ -z $dodhcp ]] && dodhcp="" [[ -z $dodhcp ]] && dodhcp=""
[[ -z $bldhcp ]] && bldhcp="" [[ -z $bldhcp ]] && bldhcp=""
[[ -z $installtype ]] && installtype="" [[ -z $installtype ]] && installtype=""
[[ -z $interface ]] && interface="" #interface=$(getFirstGoodInterface) [[ -z $interface ]] && interface=""
[[ -z $ipaddress ]] && ipaddress="" #ipaddress=$(/sbin/ip addr show $interface [[ -z $ipaddress ]] && ipaddress=""
| awk -F'[ /]+' '/global/ {print $3}') [[ -z $hostname ]] && hostname=""
[[ -z $routeraddress ]] && routeraddress="" #routeraddress=$(/sbin/ip route | aw [[ -z $routeraddress ]] && routeraddress=""
k "/$interface/ && /via/ {print \$3}") [[ -z $plainrouter ]] && plainrouter=""
[[ -z $plainrouter ]] && plainrouter="" #plainrouter=$routeraddress
[[ -z $blexports ]] && blexports=1 [[ -z $blexports ]] && blexports=1
[[ -z $installlang ]] && installlang=0 [[ -z $installlang ]] && installlang=0
[[ -z $bluseralreadyexists ]] && bluseralreadyexists=0 [[ -z $bluseralreadyexists ]] && bluseralreadyexists=0
[[ -z $guessdefaults ]] && guessdefaults=1 [[ -z $guessdefaults ]] && guessdefaults=1
[[ -z $doupdate ]] && doupdate=1 [[ -z $doupdate ]] && doupdate=1
[[ -z $ignorehtmldoc ]] && ignorehtmldoc=0 [[ -z $ignorehtmldoc ]] && ignorehtmldoc=0
[[ -z $httpproto ]] && httpproto="http" [[ -z $httpproto ]] && httpproto="http"
[[ -z $fogpriorconfig ]] && fogpriorconfig="$fogprogramdir/.fogsettings" [[ -z $fogpriorconfig ]] && fogpriorconfig="$fogprogramdir/.fogsettings"
#clearScreen #clearScreen
if [[ -z $* || $* != +(-h|-?|--help|--uninstall) ]]; then if [[ -z $* || $* != +(-h|-?|--help|--uninstall) ]]; then
echo > "$workingdir/error_logs/foginstall.log" echo > "$workingdir/error_logs/foginstall.log"
exec &> >(tee -a "$workingdir/error_logs/foginstall.log") exec &> >(tee -a "$workingdir/error_logs/foginstall.log")
fi fi
displayBanner displayBanner
echo -e " Version: $version Installer/Updater\n" echo -e " Version: $version Installer/Updater\n"
checkSELinux
checkFirewall
case $doupdate in case $doupdate in
1) 1)
if [[ -f $fogpriorconfig ]]; then if [[ -f $fogpriorconfig ]]; then
echo -e "\n * Found FOG Settings from previous install at: $fogprogr amdir/.fogsettings\n" echo -e "\n * Found FOG Settings from previous install at: $fogprogr amdir/.fogsettings\n"
echo -n " * Performing upgrade using these settings" echo -n " * Performing upgrade using these settings"
. "$fogpriorconfig" . "$fogpriorconfig"
doOSSpecificIncludes doOSSpecificIncludes
[[ -n $sblexports ]] && blexports=$sblexports [[ -n $sblexports ]] && blexports=$sblexports
[[ -n $snotpxedefaultfile ]] && notpxedefaultfile=$snotpxedefaultfil e [[ -n $snotpxedefaultfile ]] && notpxedefaultfile=$snotpxedefaultfil e
[[ -n $snoTftpBuild ]] && noTftpBuild=$snoTftpBuild [[ -n $snoTftpBuild ]] && noTftpBuild=$snoTftpBuild
[[ -n $sbootfilename ]] && bootfilename=$sbootfilename [[ -n $sbootfilename ]] && bootfilename=$sbootfilename
[[ -n $sendrange ]] && endrange=$sendrange
[[ -n $sstartrange ]] && startrange=$sstartrange
[[ -n $sbackupPath ]] && backupPath=$sbackupPath [[ -n $sbackupPath ]] && backupPath=$sbackupPath
[[ -n $swebroot ]] && webroot=$swebroot [[ -n $swebroot ]] && webroot=$swebroot
[[ -n $sdocroot ]] && docroot=$sdocroot [[ -n $sdocroot ]] && docroot=$sdocroot
[[ -n $srecreateCA ]] && recreateCA=$srecreateCA
[[ -n $srecreateKeys ]] && recreateKeys=$srecreateKeys
[[ -n $signorehtmldoc ]] && ignorehtmldoc=$signorehtmldoc [[ -n $signorehtmldoc ]] && ignorehtmldoc=$signorehtmldoc
[[ -n $ssslpath ]] && sslpath=$ssslpath
[[ -n $scopybackold ]] && copybackold=$scopybackold [[ -n $scopybackold ]] && copybackold=$scopybackold
fi fi
;; ;;
*) *)
echo -e "\n * FOG Installer will NOT attempt to upgrade from\n previo us version of FOG." echo -e "\n * FOG Installer will NOT attempt to upgrade from\n previo us version of FOG."
;; ;;
esac esac
# evaluation of command line options # evaluation of command line options
[[ -n $shttpproto ]] && httpproto=$shttpproto [[ -n $shttpproto ]] && httpproto=$shttpproto
[[ -n $sstartrange ]] && startrange=$sstartrange
[[ -n $sendrange ]] && endrange=$sendrange
[[ -n $ssslpath ]] && sslpath=$ssslpath
[[ -n $srecreateCA ]] && recreateCA=$srecreateCA
[[ -n $srecreateKeys ]] && recreateKeys=$srecreateKeys
[[ -f $fogpriorconfig ]] && grep -l webroot $fogpriorconfig >>$workingdir/error_ logs/fog_error_${version}.log 2>&1 [[ -f $fogpriorconfig ]] && grep -l webroot $fogpriorconfig >>$workingdir/error_ logs/fog_error_${version}.log 2>&1
case $? in case $? in
0) 0)
if [[ -n $webroot ]]; then if [[ -n $webroot ]]; then
webroot=${webroot#'/'} webroot=${webroot#'/'}
webroot=${webroot%'/'} webroot=${webroot%'/'}
[[ -z $webroot ]] && webroot="/" || webroot="/${webroot}/" [[ -z $webroot ]] && webroot="/" || webroot="/${webroot}/"
fi fi
;; ;;
skipping to change at line 419 skipping to change at line 432
;; ;;
esac esac
if [[ -z $backupPath ]]; then if [[ -z $backupPath ]]; then
backupPath="/home/" backupPath="/home/"
backupPath="${backupPath%'/'}" backupPath="${backupPath%'/'}"
backupPath="${backupPath#'/'}" backupPath="${backupPath#'/'}"
backupPath="/$backupPath/" backupPath="/$backupPath/"
fi fi
[[ -z $bootfilename ]] && bootfilename="undionly.kpxe" [[ -z $bootfilename ]] && bootfilename="undionly.kpxe"
[[ ! $doupdate -eq 1 || ! $fogupdateloaded -eq 1 ]] && . ../lib/common/input.sh [[ ! $doupdate -eq 1 || ! $fogupdateloaded -eq 1 ]] && . ../lib/common/input.sh
fullrelease="1.5.5"
echo echo
echo " ######################################################################" echo " ######################################################################"
echo " # FOG now has everything it needs for this setup, but please #" echo " # FOG now has everything it needs for this setup, but please #"
echo " # understand that this script will overwrite any setting you may #" echo " # understand that this script will overwrite any setting you may #"
echo " # have setup for services like DHCP, apache, pxe, tftp, and NFS. #" echo " # have setup for services like DHCP, apache, pxe, tftp, and NFS. #"
echo " ######################################################################" echo " ######################################################################"
echo " # It is not recommended that you install this on a production system #" echo " # It is not recommended that you install this on a production system #"
echo " # as this script modifies many of your system settings. #" echo " # as this script modifies many of your system settings. #"
echo " ######################################################################" echo " ######################################################################"
echo " # This script should be run by the root user. #" echo " # This script should be run by the root user. #"
echo " # It will prepend the running with sudo if root is not set #" echo " # It will prepend the running with sudo if root is not set #"
echo " ######################################################################" echo " ######################################################################"
echo " # ** Notice ** FOG is difficult to setup securely #"
echo " # SELinux and IPTables are usually asked to be disabled #"
echo " # There have been strides in adding capabilities #"
echo " # The recommendations would now be more appropriate #"
echo " # to set SELinux to permissive and to disable firewall for now. #"
echo " # You can find some methods to enable SELinux and maintain firewall #"
echo " # settings and ports. If you feel comfortable doing so please do #"
echo " ######################################################################"
echo " # Please see our wiki for more information at: #" echo " # Please see our wiki for more information at: #"
echo " ######################################################################" echo " ######################################################################"
echo " # https://wiki.fogproject.org/wiki/index.php #" echo " # https://wiki.fogproject.org/wiki/index.php #"
echo " ######################################################################" echo " ######################################################################"
echo echo
echo " * Here are the settings FOG will use:" echo " * Here are the settings FOG will use:"
echo " * Base Linux: $osname" echo " * Base Linux: $osname"
echo " * Detected Linux Distribution: $linuxReleaseName" echo " * Detected Linux Distribution: $linuxReleaseName"
echo " * Interface: $interface"
echo " * Server IP Address: $ipaddress" echo " * Server IP Address: $ipaddress"
echo " * Server Subnet Mask: $submask" echo " * Server Subnet Mask: $submask"
echo " * Interface: $interface" echo " * Server Hostname: $hostname"
case $installtype in case $installtype in
N) N)
echo " * Installation Type: Normal Server" echo " * Installation Type: Normal Server"
echo " * Internationalization: $installlang" echo " * Internationalization: $installlang"
echo " * Image Storage Location: $storageLocation" echo " * Image Storage Location: $storageLocation"
case $bldhcp in case $bldhcp in
1) 1)
echo " * Using FOG DHCP: Yes" echo " * Using FOG DHCP: Yes"
echo " * DHCP router Address: $plainrouter" echo " * DHCP router Address: $plainrouter"
;; ;;
skipping to change at line 495 skipping to change at line 500
[[ -n $autoaccept ]] && blGo="y" [[ -n $autoaccept ]] && blGo="y"
if [[ -z $autoaccept ]]; then if [[ -z $autoaccept ]]; then
echo -n " * Are you sure you wish to continue (Y/N) " echo -n " * Are you sure you wish to continue (Y/N) "
read blGo read blGo
fi fi
echo echo
case $blGo in case $blGo in
[Yy]|[Yy][Ee][Ss]) [Yy]|[Yy][Ee][Ss])
echo " * Installation Started" echo " * Installation Started"
echo echo
echo " * Installing required packages, if this fails" checkInternetConnection
echo " | make sure you have an active internet connection."
echo
if [[ $ignorehtmldoc -eq 1 ]]; then if [[ $ignorehtmldoc -eq 1 ]]; then
[[ -z $newpackagelist ]] && newpackagelist="" [[ -z $newpackagelist ]] && newpackagelist=""
for z in $packages; do for z in $packages; do
[[ $z != htmldoc ]] && newpackagelist="$newpackagelist $z" [[ $z != htmldoc ]] && newpackagelist="$newpackagelist $z"
done done
packages="$(echo $newpackagelist)" packages="$(echo $newpackagelist)"
fi fi
if [[ $bldhcp == 0 ]]; then if [[ $bldhcp == 0 ]]; then
[[ -z $newpackagelist ]] && newpackagelist="" [[ -z $newpackagelist ]] && newpackagelist=""
for z in $packages; do for z in $packages; do
 End of changes. 20 change blocks. 
32 lines changed or deleted 33 lines changed or added

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