"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/common/input.sh" between
fogproject-1.5.7.tar.gz and fogproject-1.5.8.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.

input.sh  (fogproject-1.5.7):input.sh  (fogproject-1.5.8)
skipping to change at line 32 skipping to change at line 32
strSuggestedOS=2 strSuggestedOS=2
;; ;;
*[Aa][Rr][Cc][Hh]*) *[Aa][Rr][Cc][Hh]*)
strSuggestedOS=3 strSuggestedOS=3
;; ;;
*) *)
strSuggestedOS=1 strSuggestedOS=1
;; ;;
esac esac
allinterfaces=$(getAllNetworkInterfaces) allinterfaces=$(getAllNetworkInterfaces)
strSuggestedInterface=${allinterfaces[0]} strSuggestedInterface=$(echo ${allinterfaces} | awk '{print $1}')
if [[ -z $strSuggestedInterface ]]; then if [[ -z $strSuggestedInterface ]]; then
echo "ERROR: Not able to find a network interface that is up on your sys tem." echo "ERROR: Not able to find a network interface that is up on your sys tem."
exit 1 exit 1
fi fi
strSuggestedRoute=$(ip route | grep -E "default.*${strSuggestedInterface}|${ strSuggestedInterface}.*default" | head -n1 | cut -d' ' -f3 | tr -d [:blank:]) strSuggestedRoute=$(ip route | grep -E "default.*${strSuggestedInterface}|${ strSuggestedInterface}.*default" | head -n1 | cut -d' ' -f3 | tr -d [:blank:])
if [[ -z $strSuggestedRoute ]]; then if [[ -z $strSuggestedRoute ]]; then
strSuggestedRoute=$(route -n | grep -E "^.*UG.*${strSuggestedInterface}$ strSuggestedRoute=$(route -n 2>/dev/null | grep -E "^.*UG.*${strSuggeste
" | head -n1) dInterface}$" | head -n1 | awk '{print $2}' | tr -d [:blank:])
strSuggestedRoute=$(echo ${strSuggestedRoute:16:16} | tr -d [:blank:])
fi fi
strSuggestedDNS="" strSuggestedDNS=""
[[ -f /etc/resolv.conf ]] && strSuggestedDNS=$(cat /etc/resolv.conf | grep - E "^nameserver" | head -n 1 | tr -d "nameserver" | tr -d [:blank:] | grep "^[0-9 ]*\.[0-9]*\.[0-9]*\.[0-9]*$") [[ -f /etc/resolv.conf ]] && strSuggestedDNS=$(cat /etc/resolv.conf | grep - E "^nameserver" | head -n 1 | tr -d "nameserver" | tr -d [:blank:] | grep "^[0-9 ]*\.[0-9]*\.[0-9]*\.[0-9]*$")
[[ -z $strSuggestedDNS && -d /etc/NetworkManager/system-connections ]] && st rSuggestedDNS=$(cat /etc/NetworkManager/system-connections/* | grep "dns" | head -n 1 | tr -d "dns=" | tr -d ";" | tr -d [:blank:] | grep "^[0-9]*\.[0-9]*\.[0-9 ]*\.[0-9]*$") [[ -z $strSuggestedDNS && -d /etc/NetworkManager/system-connections ]] && st rSuggestedDNS=$(cat /etc/NetworkManager/system-connections/* | grep "dns" | head -n 1 | tr -d "dns=" | tr -d ";" | tr -d [:blank:] | grep "^[0-9]*\.[0-9]*\.[0-9 ]*\.[0-9]*$")
if [[ -z $strSuggestedDNS ]]; then #If the suggested DNS is still empty, tak e further steps to get the addresses. if [[ -z $strSuggestedDNS ]]; then #If the suggested DNS is still empty, tak e further steps to get the addresses.
mkdir -p /tmp > /dev/null 2>&1 #Make sure /tmp exists, this will be the working directory. mkdir -p /tmp > /dev/null 2>&1 #Make sure /tmp exists, this will be the working directory.
cat /etc/resolv.conf | grep "nameserver" > /tmp/nameservers.txt #Get all lines from reslov.conf that have "nameserver" in them. cat /etc/resolv.conf | grep "nameserver" > /tmp/nameservers.txt #Get all lines from reslov.conf that have "nameserver" in them.
sed -i 's:#.*$::g' /tmp/nameservers.txt #Remove all comments from new fi le. sed -i 's:#.*$::g' /tmp/nameservers.txt #Remove all comments from new fi le.
sed -i -- 's/nameserver //g' /tmp/nameservers.txt #Change "nameserver " to "tmpDns=" sed -i -- 's/nameserver //g' /tmp/nameservers.txt #Change "nameserver " to "tmpDns="
sed -i '/^$/d' /tmp/nameservers.txt #Delete blank lines from temp file. sed -i '/^$/d' /tmp/nameservers.txt #Delete blank lines from temp file.
strSuggestedDNS=$(head -n 1 /tmp/nameservers.txt) #Get first DNS Address from the file. strSuggestedDNS=$(head -n 1 /tmp/nameservers.txt) #Get first DNS Address from the file.
rm -f /tmp/nameservers.txt #Cleanup after ourselves. rm -f /tmp/nameservers.txt #Cleanup after ourselves.
fi fi
strSuggestedSNUser="fogstorage"
strSuggestedHostname=$(hostname -f) strSuggestedHostname=$(hostname -f)
fi fi
displayOSChoices displayOSChoices
while [[ -z $installtype ]]; do while [[ -z $installtype ]]; do
installtype="N" installtype="N"
if [[ -z $autoaccept ]]; then if [[ -z $autoaccept ]]; then
echo " FOG Server installation modes:" echo " FOG Server installation modes:"
echo " * Normal Server: (Choice N) " echo " * Normal Server: (Choice N) "
echo " This is the typical installation type and" echo " This is the typical installation type and"
echo " will install all FOG components for you on this" echo " will install all FOG components for you on this"
skipping to change at line 254 skipping to change at line 252
installlang=0 installlang=0
;; ;;
[Yy]|[Yy][Ee][Ss]) [Yy]|[Yy][Ee][Ss])
installlang=1 installlang=1
;; ;;
*) *)
echo " Invalid input, please try again." echo " Invalid input, please try again."
;; ;;
esac esac
done done
[[ -z $snmysqlhost ]] && snmysqlhost='localhost' [[ -z $snmysqlhost ]] && snmysqlhost='localhost'
[[ -z $snmysqluser ]] && snmysqluser='root' [[ -z $snmysqluser ]] && snmysqluser='fogmaster'
while [[ -z $dohttps ]]; do
if [[ -z $autoaccept && -z $shttpproto ]]; then
echo
echo " Using encrypted connections is state of the art on the w
eb and we"
echo " encourage you to enable this for your FOG server. But us
ing HTTPS"
echo " has some implications within FOG, PXE and fog-client and
you want"
echo " to read https://wiki.fogproject.org/HTTPS before you dec
ide!"
echo -n " Would you like to enable secure HTTPS on your FOG ser
ver? [y/N] "
read dohttps
fi
[[ "$shttpproto" == "https" ]] && dohttps="yes"
case $dohttps in
[Nn]|[Nn][Oo]|"")
dohttps=0
httpproto="http"
;;
[Yy]|[Yy][Ee][Ss])
dohttps=1
httpproto="https"
;;
*)
echo " Invalid input, please try again."
dohttps=""
;;
esac
done
;; ;;
[Ss]) [Ss])
while [[ -z $snmysqlhost ]]; do while [[ -z $snmysqlhost ]]; do
echo echo
echo " What is the IP address or hostname of the FOG server running " echo " What is the IP address or hostname of the FOG server running "
echo " the fog database? This is typically the server that also " echo " the fog database? This is typically the server that also "
echo -n " runs the web server, dhcp, and tftp. IP or Hostname: " echo -n " runs the web server, dhcp, and tftp. IP or Hostname: "
read snmysqlhost read snmysqlhost
done done
strSuggestedSNUser='fogstorage'
while [[ -z $snmysqluser ]]; do while [[ -z $snmysqluser ]]; do
snmysqluser=$strSuggestedSNUser snmysqluser=$strSuggestedSNUser
if [[ -z $autoaccept ]]; then if [[ -z $autoaccept ]]; then
echo echo
echo " What is the username to access the database?" echo " What is the username to access the database?"
echo " This information is storage in the management portal und er "; echo " This information is storage in the management portal und er ";
echo " 'FOG Configuration' -> " echo " 'FOG Configuration' -> "
echo " 'FOG Settings' -> " echo " 'FOG Settings' -> "
echo " 'FOG Storage Nodes' -> " echo " 'FOG Storage Nodes' -> "
echo -n " 'FOG_STORAGENODE_MYSQLUSER'. Username [$strSuggestedS NUser]: " echo -n " 'FOG_STORAGENODE_MYSQLUSER'. Username [$strSuggestedS NUser]: "
 End of changes. 5 change blocks. 
7 lines changed or deleted 37 lines changed or added

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