• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. ch3i
    • Profile
    • Following 1
    • Followers 4
    • Topics 37
    • Posts 916
    • Best 169
    • Controversial 0
    • Groups 1

    ch3i

    @ch3i

    Moderator

    246
    Reputation
    6.3k
    Profile views
    916
    Posts
    4
    Followers
    1
    Following
    Joined Last Online
    Location Angers - France Age 43

    ch3i Unfollow Follow
    Moderator

    Best posts made by ch3i

    • [SCRIPT] FOG tools

      Hi,

      I use a script to compress images (inspired by https://forums.fogproject.org/topic/5141/compression-change/6) and display configuration of my FOG ( using https://forums.fogproject.org/topic/4581/let-s-make-scripts).

      I have terminated the compression of images present where I launch the script (to compress an image you have to launch the script on the master node of the group where the image is stored) :

      • Backup old image
      • Compress new image
      • Update database
      • Remove backup

      In futur release I want to add :

      • A progress bar on pigz (using pv maybe) >> Done
      • Checking if pigz is installed
      • function to move image in another folder/storage.

      Script (you need to have pigz installed) :

      #!/bin/bash
      ##############################################
      # Tools for FOG
      # Last change 2015-06-15
      #
      # /!\ pigz and pv are required /!\
      #
      # Ch3i
      ##############################################
      
      ##############################################
      # Functions
      ##############################################
      
      FUNC_TOP(){
      echo -e "\033[42m#########################################################
      #                 FOG Images tools                      #
      #########################################################\033[0m\n\n"
      }
      
      ##############################################
      # Get FOG configuration
      ##############################################
      
      source /opt/fog/.fogsettings
      snmysqlhost=${snmysqlhost#p:}
      logfile="FOGtroubleshoot.log"
      
      clear
      FUNC_TOP
      
      echo -e "/!\ pigz and pv are required for image compression /!\ \n"
      echo "Press Enter to continue..."; read
      
      clear
      FUNC_TOP
      
      echo -e "1 - Change image compression
      2 - Export configuration in `pwd`/$logfile
      3 - Exit\n"
      read -e fog_operation
      
      clear
      FUNC_TOP
      
      if [ "$fog_operation" == "1" ]
      then
      	##############################################
      	# List all images (id/name/compression)
      	##############################################
      
      	echo -e "Choose the image to resize\n"
      	echo -e "|ID\t| Image name (compression)"
      	echo "------------------------------------------"
      	# Display all images >> mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "SELECT images.imageID, images.imageName, images.imageCompress FROM images ORDER BY imageID" | while read image_id image_name image_compression
      	mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "SELECT images.imageID, images.imageName, images.imageCompress FROM images INNER JOIN imageGroupAssoc ON images.imageID = imageGroupAssoc.igaImageID INNER JOIN nfsGroups ON imageGroupAssoc.igaStorageGroupID = nfsGroups.ngID INNER JOIN nfsGroupMembers ON nfsGroupMembers.ngmGroupID = nfsGroups.ngID WHERE ngmHostname = '$ipaddress' ORDER BY imageID" | while read image_id image_name image_compression #Display images on the node where the script is running
      	do
      		echo -e "|$image_id\t| $image_name ($image_compression)"
      		echo "------------------------------------------"
      	done
      	echo -en "\nEnter the Image ID : "; read image_id_selected
      	echo -n "Enter the compression level (0-9) : "; read image_compression_selected
      
      	##############################################
      	# Get image selected informations
      	##############################################
      
      	image_name_selected=$(mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "SELECT images.imageName FROM images WHERE images.imageID='$image_id_selected'")
      	image_compression_original=$(mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "SELECT images.imageCompress FROM images WHERE images.imageID='$image_id_selected'")
      	image_path=$(mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "SELECT images.ImagePath FROM images WHERE images.imageID='$image_id_selected'")
      	
      	if [ "$image_compression_selected" -ge 0 -a "$image_compression_selected" -le 9 -a "$image_name_selected" != "" ]
      	then
      		echo -n "Do you want to change compression of $image_name_selected from $image_compression_original to $image_compression_selected ? (y/n) : "; read go_compression
      	else
      		echo "error"
      		echo "Exiting..."
      		sleep 1
      		clear
      		exit
      	fi
      	
      	##############################################
      	# Resize the image and update database
      	##############################################
      	if [ "$go_compression" = "Y" -o "$go_compression" = "y" ]
      	then
      		clear
      		FUNC_TOP
      		echo -e "Changing compression of $image_name_selected from $image_compression_original to $image_compression_selected : \n"
      		echo -n "Backup img...In progress"
      		for f in "$storageLocation/$image_path/"*.img; do mv "$f" "${f%.img}-bak.img"; done
      		echo -e "\033[1K"
      		echo "Backup img...Done"
      		echo "Compress new img...In progress"
      		for f in "$storageLocation/$image_path/"*bak.img; do pigz -d -c $f | pv $f | pigz -"$image_compression_selected" > "${f%-bak.img}.img"; done
      		echo -e "\033[1K"
      		echo "Compress new img...Done"
      		echo -n "Remove backups...In progress"
      		rm "$storageLocation/$image_path/"*bak.img
      		chmod 777 -R "$storageLocation/$image_path/"
      		echo -e "\033[1K"
      		echo "Remove backups...Done"
      		echo -n "Update database...In progress"
      		mysql --host="$snmysqlhost" --user="$snmysqluser" --password="$snmysqlpass" "fog" -Bse "UPDATE images SET images.imageCompress='$image_compression_selected' WHERE images.imageID='$image_id_selected'"
      		echo -e "\033[1K"
      		echo "Update database...Done"
      		echo "Exiting..."
      		sleep 1
      		exit
      	else
      		echo "Exiting..."
      		sleep 1
      		clear
      		exit
      	fi
      elif [ "$fog_operation" == "2" ]
      then
      	##############################################
      	# Export Configuration
      	##############################################
      
      	(( EUID != 0 )) && exec sudo -- "$0" "$@"
      	linuxReleaseName=`lsb_release -a 2> /dev/null | grep "Distributor ID" | awk '{print $3,$4,$5,$6,$7,$8,$9}' | tr -d " "`;
      	if [ -z "$linuxReleaseName" ]; then
      		# Fall back incase lsb_release does not exist / fails - use /etc/issue over /etc/*release*
      		linuxReleaseName=`cat /etc/issue /etc/*release* 2>/dev/null | head -n1 | awk '{print $1}'`;
      	fi
      	#logfile="FOGtroubleshoot.log"
      	# Delete logfile if it exists
      	if [ -f $logfile ]; then
      		rm $logfile
      	fi
      	#argument 1 is the logfile name
      	getStatus() {
      		i=1;
      		if [ ! -z "`echo $linuxReleaseName | grep -Ei 'Fedora|Redhat|CentOS|Mageia'`" ]; then
      			RHVER=`rpm -qa | grep release | xargs rpm -q --queryformat '%{VERSION}' | cut -c -1`;
      		fi
      		if [ "`echo $RHVER`" -gt 6 ]; then
      			services="xinetd rpcbind nfs-server vsftpd firewalld FOGMulticastManager FOGSnapinReplicator FOGImageReplicator FOGScheduler";
      			nicename="TFTP RPCBind NFS FTP Firewall FOGMulticastManager FOGSnapinReplicator FOGImageReplicator FOGScheduler";
      			for service in $services; do
      				niceval=`echo $nicename|awk '{print $'$i'}' |sed 's/_/ /'`;
      				echo "----------------------$niceval status below" >> $1
      				systemctl status $service >> $1;
      				i=`expr $i '+' 1`;
      			done
      		else
      			services="xinetd rpcbind nfs vsftpd iptables FOGMulticastManager FOGSnapinReplicator FOGImageReplicator FOGScheduler";
      			nicename="TFTP RPCBind NFS FTP Firewall FOGMulticastManager FOGSnapinReplicator FOGImageReplicator FOGScheduler";
      			for service in $services; do
      				niceval=`echo $nicename|awk '{print $'$i'}' |sed 's/_/ /'`;
      				echo "----------------------$niceval status below" >> $1
      				service $service status >> $1;
      				i=`expr $i '+' 1`;
      			done
      		fi
      	}
      	#argument 1 is the logfile name
      	getLogs() {
      		if [ ! -z "`echo $linuxReleaseName | grep -Ei 'Fedora|Redhat|CentOS|Mageia'`" ]; then
      			httploc='httpd';
      			httpsep='_';
      		else
      			httploc='apache2';
      			httpsep='.';
      		fi
      		logs="/var/log/foginstall.log /var/log/${httploc}/error${httpsep}log /var/log/${httploc}/access${httpsep}log";
      		nicename="Installation Apache_Error Apache_Access";
      		i=1;
      		for lfname in $logs; do
      			if [ -f "$lfname" ]; then
      				niceval=`echo $nicename|awk '{print $'$i'}' |sed 's/_/ /'`;
      				echo ----------------------$niceval log below >> $1;
      				tail -30 $lfname >> $1
      			fi
      			i=`expr $i '+' 1`;
      		done
      	}
      	#argument 1 is the logfile name
      	getConfs() {
      		conffiles="/etc/dhcp/dhcpd.conf /etc/dnsmasq.d/ltsp.conf /etc/xinetd.d/tftp /etc/vsftpd/vsftpd.conf /etc/rc.d/rc.local";
      		for confname in $conffiles; do
      			if [ -f "$confname" ]; then
      				echo "----------------------$confname file below" >> $1;
      				cat $confname >> $1;
      			fi
      		done
      	}
      	echo '----------------------'$linuxReleaseName' version below' >> $logfile
      	cat /etc/issue >> $logfile
      	if [ ! -z "`echo $linuxReleaseName | grep -Ei 'Fedora|Redhat|CentOS|Mageia'`" ]; then
      		echo '----------------------SELinux status below' >> $logfile;
      		sestatus >> $logfile
      	fi
      	echo '----------------------IP Configuration below' >> $logfile
      	ip addr >> $logfile
      	getStatus $logfile;
      	getLogs $logfile;
      	getConfs $logfile;
      	storageLocation="/images";
      	if [ -d "/opt/fog" -a -f "/opt/fog/.fogsettings" ]; then
      		. /opt/fog/.fogsettings;
      	fi
      	if [ -d "$storageLocation" ]; then
      		echo '----------------------Check for /images/.mntcheck' >> $logfile
      		ls $storageLocation -a |grep "mntcheck" >> $logfile
      		echo '----------------------Check for /images/dev/.mntcheck' >> $logfile
      		ls ${storageLocation}/dev -a |grep "mntcheck" >> $logfile
      		echo '----------------------/images & file permissions below' >> $logfile
      		ls -lR $storageLocation >> $logfile
      	fi
      	if [ -d "/tftpboot" ]; then
      		echo '----------------------/tftpboot & file permissions below' >> $logfile
      		ls -lR /tftpboot >> $logfile
      	fi
      	sed -i 's/$/
      	/g' $logfile
      	echo -n "Script Completed ";
      	date
      	echo "Your logfile can be found in `pwd`/$logfile";
      	echo "Exiting..."
      	sleep 1
      	exit
      else
      	echo "Exiting..."
      	sleep 1
      	clear
      	exit
      fi
      

      It’s not perfect but functional, I used it without problem, if you want to test it make a backup of the target image before 😄

      Ch3i.

      posted in Tutorials
      ch3iC
      ch3i
    • RE: Weird installer behavior - latest trunk - brand new server build

      @Wayne-Workman Partially solved…

      0_1447746331223_upload-04a3ae86-3b52-4d55-9616-b60f93f3740a

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: Fog Client on Hyper-V

      @naysweb said:

      @Tom-Elliott Thanks, How long do you think it might be released in the stable version. 🙂

      SVN is relatively stable. Many of us use it in production 😛

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: Imaging Windows 10

      @Junkhacker said:

      testing with the available pre-release versions of Windows 10 have at this time had no issue with compatibility with fog.

      Same here, I’ve tested it today.

      posted in General
      ch3iC
      ch3i
    • [3696 - 3710] Debian 7 - php5-json and host view

      Hi,

      I’ve a bug on host general display in 3696 revision :
      Capture.PNG

      I’ve updated to 3710 and same problem. I’ve checked the function.sh file and saw that it was my “custom version” (https://forums.fogproject.org/topic/5304/3639-php5-json-failed/7).

      I’ve deleted the SVN folder, checkout fog svn and now when I want to install fog I’ve that error :

        Confirming package installation.
      
       * Checking package: apache2...................................OK
       * Checking package: php5......................................OK
       * Checking package: php5-json.................................Failed!
      

      Same error that Tom has fixed a week ago.

      Regards,
      Ch3i.

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: Image size on server

      @Polii123 https://forums.fogproject.org/topic/4949/deployment-ftp-not-working

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: Explore FOG images for file recovery?

      @rrjustin There are some topics about that using gzip/partlcone tools/mount on the FOG forum. As said @Junkhacker the simple way is to restore to another computer/vm.

      I’m working on a tool to decompress mount img via script and browse it via web UI.

      posted in General
      ch3iC
      ch3i
    • Select multiple partition to deploy/capture

      Hi,

      I’ve tried today to capture only one partition and deploy it on 300 hots without problem.
      Is there a way to capture a whole disk and deploy only one or more partitions ?

      It’ll be very usefull when you create de deploy task to select one or more partition you want to deploy.

      In my case : I’ve One partition Windows (OS), one partition Linux (OS), one partition Windows (data) and one partition Linux (data). In some cases I’ve to update two or more partitions. To do that I deploy the whole disk on each host instead deployed only the partitions updated.

      Regards,
      Ch3i.

      posted in Feature Request
      ch3iC
      ch3i
    • [SCRIPTS] Customization of Ubuntu - "Fog Service" for Ubuntu

      Hi,

      I made two scripts to customize a master and enabled a “Fog Service” in ubuntu.
      I used it in dual boot configuration (Win7/Ubuntu 14.04)

      The first script - Cutom_My_Master (only launch on the master to prepare image) :

      • Update host (apt-get update / upgrade)
      • Modify Grub : Set timeout to 30s and default boot
      • Modify Gnome authentication : Disable login history
      • Enable Fog Service : add a service that allow to modify hostname, domain at startup/shutdown
      • Display a cool Hello Kitty at end (It was to justify my daughter why I was working at home)

      The second script - host_rename_fog (it’s the “FOG client”) :

      • It’s installed as a service
      • Update hostname and domain by contacting Fog Mysql Server (at startup/shutdown)
        -> Detect all networks cards and check if a mac address is present in Fog. If the hostname or domain is different it apply the update
        ->Turn all interfaces in DHCP in /etc/network/interface
        -> Updating /etc/hosts and /etc/hostname
        -> Remove persistent cards, very usefull in deployment
        -> Automatically restart machine to apply modification, and modify default boot to ubuntu once time.

      Howto :
      1/ Copy paste the code below in two files (saved in the same folder) : Custom_My_Master (in my case) and rename_host_fog (the name is important for this file, it’s used to declare the script in the init process).
      2/ Change right of Custom_My_Master : chmod 755 Custom_My_Master
      3/ Modify the rename_host_fog to match with your fog installation
      4/ Run Custom_My_Master : ./Custom_My_Master

      Scripts :

      Custom_My_Master

      #!/bin/bash
      #########################################################
      # Configure Ubuntu in Dual Boot
      #########################################################
      # Ch3i- 02/19/2015
      #########################################################
      
      #########################################################
      # Functions
      #########################################################
      
      FUNC_END(){
      echo -e "\033[45m##########################################################################
      #                          Updates Finished                              #
      ##########################################################################"
      cat <<"EOT"
                                                                                
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!`   `4!!!!!!!!!!~4!!!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   <~:   ~!!!~   ..  4!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ~~~~~~~     ud$$$$$  !!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ~~~~~~~~~: ?$$$$$$$$$  !!!!!!!!!!!!!!
      !!!!!!!!!!!`     ``~!!!!!!!!!!!!!!  ~~~~~           *$$$$$k `!!!!!!!!!!!!!
      !!!!!!!!!!  $$$$$bu.   ~!~`     .   ~~~~      :~~~~          `4!!!!!!!!!!!
      !!!!!!!!!  $$$$$$$$$$$c  .zW$$$$$E ~~~~      ~~~~~~~~  ~~~~~:   !!!!!!!!!!
      !!!!!!!!! d$$$$$$$$$$$$$$$$$$$$$$E ~~~~~     ~~~~~~~~    ~~~~~  !!!!!!!!!!
      !!!!!!!!> 9$$$$$$$$$$$$$$$$$$$$$$$  ~~~~~~~  ~~~~~~~~     ~~~~  !!!!!!!!!!
      !!!!!!!!> $$$$$$$$$$$$$$$$$$$$$$$$b   ~~~     ~~~~~~~      ~~~  !!!!!!!!!!
      !!!!!!!!> $$$$$$$$$$$$$$$$$$$$$$$$$$$cuuue$$N.   ~        ~~~  !!!!!!!!!!!
      !!!!!!!!! **$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$Ne  ~~~~~~~~  `!!!!!!!!!!!
      !!!!!!!!!  J$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$N  ~~~~~  zL  !!!!!!!!!!
      !!!!!!!!  d$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$c     z$$$c `!!!!!!!!!
      !!!!!!!> <$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$> 4!!!!!!!!
      !!!!!!!  $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  !!!!!!!!
      !!!!!!! <$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*    ....:!!
      !!!!!!~ 9$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$e@$N  !!!!!!!
      !!!!!!  9$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  !!!!!!!
      !!!!!!  $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  $$$$$$$$$$$~ ~~4!!!!
      !!!!!!  9$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$    $$$$$$$Lue  :::!!!!
      !!!!!!> 9$$$$$$$$$$$$   $$$$$$$$$$$$$$$$$$$$$$$$$$$    $$$$$$$$$$  !!!!!!!
      !!!!!!!  $$*$$$$$$$$E    $$$$$$$$$$$$$$$$$$$$$$$$$$$u.@$$$$$$$$$E  !!!!!!!
      !!!!~`   .eeW$$$$$$$$   :$$$$$$$$$$$$$***$$$$$$$$$$$$$$$$$$$$u.    `~!!!!!
      !!> .:!h  $$$$$$$$$$$$ed$$$$$$$$$$$$Fz$$b $$$$$$$$$$$$$$$$$$$$$F  !h.  !!!
      !!!!!!!!L  $**$$$$$$$$$$$$$$$$$$$$$$ *$$$ $$$$$$$$$$$$$$$$$$$$F  !!!!!!!!!
      !!!!!!!!!   d$$$$$$$$$$$$$$$$$$$$$$$$buud$$$$$$$$$$$$$$$$$$$$   !!!!!!!!!!
      !!!!!!! .<!  #$$* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*  :!!!!!!!!!!!
      !!!!!!!!!!!!:   d$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#  :!!!!!!!!!!!!!
      !!!!!!!!!!!~  :   #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*     !!!!!!!!!!!!!!!
      !!!!!!!!!!  !!!!!:   ^ **$$$$$$$$$$$$$$$$$$$$**#      .:<!!!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!:...                      .::!!!!!!!!!!!!!!!!!!!!!!!!
      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                                                                                
      EOT
      echo -e "\033[0m\n\n"
      }
      
      FUNC_TOP(){
      echo -e "\033[42m#########################################################
      #         Custom My Master - New master deploy          #
      #########################################################\033[0m\n\n"
      
      if [ "$STATUS_UPDATE_UPDATE" == "1" ]
      then
      	echo -n "Update in progress...";
      fi
      if [ "$STATUS_UPDATE_UPDATE" == "2" ]
      then
      	echo "Update in progress... Done";
      fi
      
      if [ "$STATUS_UPDATE_GRUB" == "1" ]
      then
      	echo -n "Grub configuration in progress...";
      fi
      if [ "$STATUS_UPDATE_GRUB" == "2" ]
      then
      	echo "Grub configuration in progress... Done";
      fi
      
      if [ "$STATUS_UPDATE_GNOME" == "1" ]
      then
      	echo -n "Gnome configuration in progress...";
      fi
      if [ "$STATUS_UPDATE_GNOME" == "2" ]
      then
      	echo "Gnome configuration in progress... Done";
      fi
      
      if [ "$STATUS_UPDATE_FOG" == "1" ]
      then
      	echo -n "Fog Service configuration in progress...";
      fi
      if [ "$STATUS_UPDATE_FOG" == "2" ]
      then
      	echo "Fog Service configuration in progress... Done";
      fi
      }
      
      #########################################################
      # Vars initialization
      #########################################################
      STATUS_UPDATE_UPDATE=0
      STATUS_UPDATE_GRUB=0
      STATUS_UPDATE_GNOME=0
      STATUS_UPDATE_FOG=0
      
      #########################################################
      # Menu
      #########################################################
      clear
      
      FUNC_TOP
      
      echo -e "\033[42m1 - Host Update (apt-get update/upgrade) 
      2 - Grub Configuration                   
      3 - Gnome Authentication                 
      4 - Enable Fog Service                   
      5 - All                                  
      6 - Exit                                 \033[0m\n"
      echo -n "Your select : " 
      read -e HOST_ACTIONS
      
      
      #########################################################
      # Host Update
      #########################################################
      if [ "$HOST_ACTIONS" == "1" ] || [ "$HOST_ACTIONS" == "5" ]
      then
      	clear
      	STATUS_UPDATE_UPDATE=1
      	FUNC_TOP
      	
      	apt-get update > /dev/null 2>&1
      	apt-get -y upgrade  > /dev/null 2>&1
      	
      	clear
      	STATUS_UPDATE_UPDATE=2
      	FUNC_TOP
      fi
      
      
      #########################################################
      # Grub Configuration (Set default boot, timeout, ...)
      #########################################################
      if [ "$HOST_ACTIONS" == "2" ] || [ "$HOST_ACTIONS" == "5" ]
      then
      	#########################################################
      	# Update Grub Configuration (Grub 2.0+)
      	#########################################################
      	
      	clear
      	STATUS_UPDATE_GRUB=1
      	FUNC_TOP
      
      	# Enabled grub-set-default
      	sed -i -e "s/\GRUB_DEFAULT=0/\GRUB_DEFAULT=saved/g" /etc/default/grub
      
      	# Set timeout at 30 seconds
      	sed -i -e "s/\GRUB_TIMEOUT=10/\GRUB_TIMEOUT=30/g" /etc/default/grub
      
      	# Removed memtest from /boot
      	rm /boot/memtest*  > /dev/null 2>&1
      
      	# Update Entry
      	update-grub2  > /dev/null 2>&1
      
      	# Set default entry from Eric Zhiqiang Ma (http://www.ericzma.com)
      	grep "^menuentry" /boot/grub/grub.cfg | cut -d "'" -f2 >/tmp/grub2-select.entries
      
      	items=`cat /tmp/grub2-select.entries`
      
      	linen=`cat /tmp/grub2-select.entries | wc -l`
      	
      	echo "\n"
      	
      	j=0
      	while [ $j -lt $linen ]
      	do
      		let "j=j+1"
      		echo -n "$j  "
      		echo "$items" | head -n $j | tail -n1
      	done
      
      	echo -n -e "\nYour select: "
      	read sel
      
      	selected=`echo "$items" | head -n $sel | tail -n1`
      
      	grub-set-default "$selected"
      	grub-mkconfig -o /boot/grub/grub.cfg  > /dev/null 2>&1
      	
      	clear
      	STATUS_UPDATE_GRUB=2
      	FUNC_TOP
      fi
      
      
      
      #########################################################
      # Gnome Authentication (Disable login history)
      #########################################################
      if [ "$HOST_ACTIONS" == "3" ] || [ "$HOST_ACTIONS" == "5" ]
      then
      	#########################################################
      	# Update Gnome Authentication
      	#########################################################
      	
      	clear
      	STATUS_UPDATE_GNOME=1
      	FUNC_TOP
      	
      	echo "greeter-hide-users=true
      greeter-show-manual-login=true" >> /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
      
      	clear
      	STATUS_UPDATE_GNOME=2
      	FUNC_TOP
      	
      	fi
      
      #########################################################
      # Enable Fog Service
      #########################################################
      if [ "$HOST_ACTIONS" == "3" ] || [ "$HOST_ACTIONS" == "5" ]
      then
      	
      	clear
      	STATUS_UPDATE_FOG=1
      	FUNC_TOP
      	
      	#########################################################
      	# Install/update mysql-client
      	#########################################################
      	apt-get -y install mysql-client  > /dev/null 2>&1
      
      	#########################################################
      	# Copy/update rename_host_fog script in init.d
      	#########################################################
      	if [ -f /etc/init.d/rename_host_fog ]
      	then
      		rm /etc/init.d/rename_host_fog
      	fi
      	cp rename_host_fog /etc/init.d/rename_host_fog
      
      	#########################################################
      	# Update rename_host_fog rights
      	#########################################################
      	chmod 755 /etc/init.d/rename_host_fog
      
      	#########################################################
      	# Enable rename_host_fog service at startup
      	#########################################################
      	/usr/lib/insserv/insserv rename_host_fog
      	
      	clear
      	STATUS_UPDATE_FOG=2
      	FUNC_TOP
      	
      fi
      
      #########################################################
      # Restart host
      #########################################################
      if [ "$HOST_ACTIONS" == "1" ] || [ "$HOST_ACTIONS" == "2" ] || [ "$HOST_ACTIONS" == "3" ] || [ "$HOST_ACTIONS" == "4" ] || [ "$HOST_ACTIONS" == "5" ]
      then
      	
      	clear
      	FUNC_TOP
      	
      	echo -e "\n\n"
      	echo -e -n "\033[41mRestart host ? (y/N) : \033[0m"; read -e HOST_RESTART
      	
      	clear
      	FUNC_END
      	
      	if [ "$HOST_RESTART" == "y" ] || [ "$HOST_RESTART" == "Y" ]
      	then
      		sleep 3
      		grub-reboot 0
      		/sbin/init 6
      	fi
      else
      	clear
      	exit
      fi
      

      host_rename_fog

      #!/bin/bash
      #########################################################
      # Rename services with FoG, need mysql-client installed
      #########################################################
      # ch3i - 09/11/2015
      #########################################################
      
      ### BEGIN INIT INFO
      # Provides:          rename_host_fog
      # Required-Start:    $all
      # Required-Stop:     
      # Default-Start:     2 3 4 5
      # Default-Stop:      0 1 6
      # Short-Description: Rename host at boot-shutdown
      # Description:       Rename host using FoG
      ### END INIT INFO
      
      #########################################################
      # Functions
      #########################################################
      FUNC_DOTS() {
          max=65
          if [ -n "$1" ]; then
      		n=`expr $max - ${#1}`
      		echo -n " * ${1:0:max}"
      		if [ "$n" -gt 0 ]; then
      			for i in $(seq $n); do
      				printf %s .
      			done
      		fi
      	fi
      }
      
      #########################################################
      # Configuration
      #########################################################
      FOG_SERVER="server_ip"
      FOG_DATABASE_NAME="fog"
      FOG_USER="simple_select_user"
      FOG_PASSWORD="simple_select_user_password"
      
      #########################################################
      # Check Mysql Client installation
      #########################################################
      FUNC_DOTS "Check Mysql Configuration"
      if [ $(dpkg-query -W -f='${Status}' mysql-client* 2>/dev/null | grep -c "ok installed") -eq 0 ];
      then
        apt-get install -y mysql-client > /dev/null 2>&1
      fi
      echo "Done"
      
      #########################################################
      # Check Mysql Server status
      #########################################################
      FUNC_DOTS "Check FOG Mysql Database Status"
      mysqladmin -h $FOG_SERVER -u$FOG_USER -p$FOG_PASSWORD processlist > /dev/null 2>&1
      if [ $? -eq 1 ]
      then
      	echo "Error"
      	FUNC_DOTS "Failed to connect to server"
      	echo "Exiting"
      	sleep 3
      	exit
      else
      	echo "Done"
      	
      	#########################################################
      	# Get interfaces
      	#########################################################
      	NETWORK_CARDS=($(ls /sys/class/net | grep eth))
      
      	#########################################################
      	# Get host name and domain from FoG database
      	#########################################################
      	FUNC_DOTS "Checking hostname/domain configurations"
      	for ETH in ${NETWORK_CARDS[*]}
      	do
      			MAC=$(cat /sys/class/net/$ETH/address)
      			TEMP_HOST_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se "SELECT hosts.hostname FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = '$MAC'");
      			if [ "$TEMP_HOST_NAME" != "" ]
      			then
      				HOST_NAME=$TEMP_HOST_NAME
      				HOST_DOMAIN_NAME=$(mysql --host=$FOG_SERVER --user=$FOG_USER --password=$FOG_PASSWORD $FOG_DATABASE_NAME -se "SELECT hosts.hostADDomain FROM hosts INNER JOIN hostMAC ON ( hosts.hostID = hostMAC.hmHostID ) WHERE hostMAC.hmMAC = '$MAC'")
      				echo "Done ($HOST_NAME.$HOST_DOMAIN_NAME)"
      				sleep 3
      				# A hostname is found - quit the loop
      				break
      			else
      				echo "Error"
      				FUNC_DOTS "Host not found in FOG database"
      				echo "exiting"
      				sleep 3
      				exit
      			fi
      	done
      
      	#########################################################
      	# Check host configuration
      	#########################################################
      	ACTUAL_FQDN=$(hostname --fqdn)
      	if [ "$HOST_NAME.$HOST_DOMAIN_NAME" != "$ACTUAL_FQDN" -a "$HOST_NAME" != "" -a "$HOST_DOMAIN_NAME" != "" ]
      	then
      	
      		#########################################################
      		# Update hostname file
      		#########################################################
      		FUNC_DOTS "Updating /etc/hostname"
      		echo $HOST_NAME >/etc/hostname
      		echo "Done"
      
      		#########################################################
      		# Update hosts file
      		#########################################################
      		FUNC_DOTS "Updating /etc/hosts"
      		echo "127.0.0.1       localhost" > /etc/hosts
      		echo "127.0.1.1       $HOST_NAME.$HOST_DOMAIN_NAME $HOST_NAME " >> /etc/hosts
      		echo "# The following lines are desirable for IPv6 capable hosts
      ::1     ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      ff02::3 ip6-allhosts" >> /etc/hosts
      		echo "Done"
      		
      		#########################################################
      		# Update interfaces file
      		#########################################################
      		FUNC_DOTS "Updating /etc/network/interfaces"
      		echo "# This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).
      
      # The loopback network interface
      auto lo
      iface lo inet loopback" > /etc/network/interfaces
      
      		for ETH in ${NETWORK_CARDS[*]}
      		do
      			if [ "$ETH" != "lo" ]
      			then
      			echo "# $ETH Interface
      allow-hotplug $ETH
      iface $ETH inet dhcp" >> /etc/network/interfaces
      			fi
      		done
      		echo "Done"
      
      		#########################################################
      		# Clear persistent network cards
      		#########################################################
      		FUNC_DOTS "Clearing persistent networks cards"
      		if [ -f /etc/udev/rules.d/70-persistent-net.rules ]
      		then
      			rm /etc/udev/rules.d/70-persistent-net.rules
      		fi
      		echo "Done"
      
      		#########################################################
      		# Logs and Reboot machine
      		#########################################################
      		FUNC_DOTS "Building rename logs"
      		echo "$(date) ::: Update successful with Hostname : $HOST_NAME and Domain : $HOST_DOMAIN_NAME" >> /var/log/rename_host_fog.log
      		echo "Done"
      		grub-reboot 0
      		/sbin/init 6
      		exit		
      	fi
      	if [ "$HOST_NAME" == "" -a "$HOST_DOMAIN_NAME" == "" ]
      	then
      		echo "$(date) ::: Update failed : Failed to connect to Mysql Server" >> /var/log/rename_host_fog.log
      	fi
      	if [ "$HOST_NAME" != "" -a "$HOST_DOMAIN_NAME" == "" ]
      	then
      		echo "$(date) ::: Update failed : Domain name is missing" >> /var/log/rename_host_fog.log
      	fi
      fi
      exit
      

      host_rename_fog (without using of MySQL) :

      #!/bin/bash
      #########################################################
      # Rename services with FoG, need mysql-client installed
      #########################################################
      # ch3i - 09/11/2015
      #########################################################
      
      ### BEGIN INIT INFO
      # Provides:          rename_host_fog
      # Required-Start:    $all
      # Required-Stop:     
      # Default-Start:     2 3 4 5
      # Default-Stop:      0 1 6
      # Short-Description: Rename host at boot-shutdown
      # Description:       Rename host using FoG
      ### END INIT INFO
      
      #########################################################
      # Functions
      #########################################################
      FUNC_DOTS() {
          max=65
          if [ -n "$1" ]; then
      		n=`expr $max - ${#1}`
      		echo -n " * ${1:0:max}"
      		if [ "$n" -gt 0 ]; then
      			for i in $(seq $n); do
      				printf %s .
      			done
      		fi
      	fi
      }
      
      #########################################################
      # Configuration
      #########################################################
      FOG_SERVER="ip_of_server"
      FOG_WEBROOT="fog"
      
      #########################################################
      # Check FOG Server Status
      #########################################################
      FUNC_DOTS "Check FOG web service Status"
      wget "http://$FOG_SERVER/$FOG_WEBROOT/index.php" -t 1 2>/dev/null
      if [ $? -eq 0 ]
      then
      	echo "Done"
      	
      	#########################################################
      	# Get interfaces
      	#########################################################
      	NETWORK_CARDS=($(ls /sys/class/net | grep eth))
      
      	#########################################################
      	# Get host name and domain from FoG database
      	#########################################################
      	FUNC_DOTS "Checking hostname/domain configurations"
      	for ETH in ${NETWORK_CARDS[*]}
      	do
      			# read mac address
      			MAC=$(cat /sys/class/net/$ETH/address)
      			# get mac address information from fog web server
      			wget http://$FOG_SERVER/$FOG_WEBROOT/service/hostname.php?mac=$MAC -O /tmp/hostname_check 2>/dev/null
      			HOST_NAME="$(grep 'ok=' /tmp/hostname_check | cut -d "=" -f2)"
      			HOST_DOMAIN_NAME="$(grep 'ADDom' /tmp/hostname_check | cut -d "=" -f2)"
      			if [ "$HOST_NAME" != "" ]
      			then
      				echo "Done ($HOST_NAME.$HOST_DOMAIN_NAME)"
      				sleep 3
      				# A hostname is found - quit the loop
      				break
      			else
      				echo "Error"
      				FUNC_DOTS "Host not found in FOG database"
      				echo "exiting"
      				sleep 3
      				exit
      			fi
      	done
      
      	#########################################################
      	# Check host configuration
      	#########################################################
      	ACTUAL_FQDN=$(hostname --fqdn)
      	if [ "$HOST_NAME.$HOST_DOMAIN_NAME" != "$ACTUAL_FQDN" -a "$HOST_NAME" != "" -a "$HOST_DOMAIN_NAME" != "" ]
      	then
      	
      		#########################################################
      		# Update hostname file
      		#########################################################
      		FUNC_DOTS "Updating /etc/hostname"
      		echo $HOST_NAME >/etc/hostname
      		echo "Done"
      
      		#########################################################
      		# Update hosts file
      		#########################################################
      		FUNC_DOTS "Updating /etc/hosts"
      		echo "127.0.0.1       localhost" > /etc/hosts
      		echo "127.0.1.1       $HOST_NAME.$HOST_DOMAIN_NAME $HOST_NAME " >> /etc/hosts
      		echo "# The following lines are desirable for IPv6 capable hosts
      ::1     ip6-localhost ip6-loopback
      fe00::0 ip6-localnet
      ff00::0 ip6-mcastprefix
      ff02::1 ip6-allnodes
      ff02::2 ip6-allrouters
      ff02::3 ip6-allhosts" >> /etc/hosts
      		echo "Done"
      		
      		#########################################################
      		# Update interfaces file
      		#########################################################
      		FUNC_DOTS "Updating /etc/network/interfaces"
      		echo "# This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).
      
      # The loopback network interface
      auto lo
      iface lo inet loopback" > /etc/network/interfaces
      
      		for ETH in ${NETWORK_CARDS[*]}
      		do
      			if [ "$ETH" != "lo" ]
      			then
      			echo "# $ETH Interface
      allow-hotplug $ETH
      iface $ETH inet dhcp" >> /etc/network/interfaces
      			fi
      		done
      		echo "Done"
      
      		#########################################################
      		# Clear persistent network cards
      		#########################################################
      		FUNC_DOTS "Clearing persistent networks cards"
      		if [ -f /etc/udev/rules.d/70-persistent-net.rules ]
      		then
      			rm /etc/udev/rules.d/70-persistent-net.rules
      		fi
      		echo "Done"
      
      		#########################################################
      		# Logs and Reboot machine
      		#########################################################
      		FUNC_DOTS "Building rename logs"
      		echo "$(date) ::: Update successful with Hostname : $HOST_NAME and Domain : $HOST_DOMAIN_NAME" >> /var/log/rename_host_fog.log
      		echo "Done"
      		grub-reboot 0
      		/sbin/init 6
      		exit		
      	fi
      	if [ "$HOST_NAME" == "" -a "$HOST_DOMAIN_NAME" == "" ]
      	then
      		echo "$(date) ::: Update failed : Failed to connect to Mysql Server" >> /var/log/rename_host_fog.log
      	fi
      	if [ "$HOST_NAME" != "" -a "$HOST_DOMAIN_NAME" == "" ]
      	then
      		echo "$(date) ::: Update failed : Domain name is missing" >> /var/log/rename_host_fog.log
      	fi
      else
      	echo "Error"
      	FUNC_DOTS "Failed to connect to server"
      	echo "Exiting"
      	sleep 3
      	exit
      fi
      exit
      
      posted in General
      ch3iC
      ch3i
    • RE: Cannot Download most images

      @Tim.Trageser said:

      Maybe you need to stop and start a service in FOG after changing .fogsettings?

      Hi,

      The .fogsettings is used for the installation of FOG. If you modify the .fogsettings you must run the installer again.

      Regards,
      Ch3i.

      posted in FOG Problems
      ch3iC
      ch3i

    Latest posts made by ch3i

    • RE: FOG clone IP address issue (holding onto cloned IP)

      hi, maybe more informations lol

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: Cannot add pushbullet account (nothing happens when i click on add)

      @x23piracy HI, I’ve you checked your apache log ?

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: FOG client on ubuntu 16

      @sebastian-roth I’ll post the fog.log when the problem will happen on other computers.

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: FOG client on ubuntu 16

      @sebastian-roth said in FOG client on ubuntu 16:

      @ch3i Thanks for reporting. I’ll look into this soon! Do you know if this is a general problem with the fog-client on linux or is it Ubuntu specific? Which version of Ubuntu do you have? 16.04.3?

      Never test on other version of linux, only on ubuntu :

      root@WEIER01:~# uname -a
      Linux WEIER01 4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
      

      Regards, Ch3i

      posted in Bug Reports
      ch3iC
      ch3i
    • FOG client on ubuntu 16
      Server
      • FOG Version: 1.5.0-RC-9
      • OS: Debian 8
      Client
      • Service Version: 0.11.12
      • OS: Ubuntu 16
      Description

      Hi, I use FOG client on a dual boot system, I’ve no problem on Windows Client. But on Linux (Ubuntu 16) when I reset encryption data I’ve to restart FOGservice to enable change (A reboot is useless, it’s not functionnal).

      The second problem is that the FOGService hang the shutdwon of my ubuntu during 30 sec (the default max time to stop a service during shutdown process).

      Regards, Ch3i.

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: Windows 10 key after deployment

      @x23piracy said in Windows 10 key after deployment:

      but pssst i also do it 🙂

      Shame on you lol

      posted in Windows Problems
      ch3iC
      ch3i
    • RE: Deleting a host item in the web GUI - invalid login

      @sebastian-roth said in Deleting a host item in the web GUI - invalid login:

      Server

      FOG Version: 1.5.0 RC9 (also seen in RC8)
      OS: Debian 8

      Description
      When deleting a host item I get a confirmation window asking for credentials. So far so good. Entering my login data and hitting “delete” I get the answer “Invalid Login” but host is still deleted from the DB. I’ve seen this on RC8 and RC9 servers.

      Same error for me.

      posted in Bug Reports
      ch3iC
      ch3i
    • RE: full host registration error

      @tom-elliott said in full host registration error:

      Please update to the rc version. I know of the issue already and it’s fixed.

      https://wiki.fogproject.org/wiki/index.php?title=Upgrade_to_trunk

      posted in FOG Problems
      ch3iC
      ch3i
    • RE: FOG 1.5.0 RC 9

      Plop, Really thx man !

      posted in Announcements
      ch3iC
      ch3i
    • Reset Encryption Data in group menu
      Server
      • FOG Version: 1.5.0-RC-8
      • OS: Debian 8
      Description

      Hi,
      When I click on the “Reset Encryption Data” on a group there is nothing happend. But when I click on a single computer it’s OK.
      I’ve nothing on Apache log

      posted in Bug Reports
      ch3iC
      ch3i