Commit c2f6c7f4 authored by Marco Marinello's avatar Marco Marinello

Manual configuration if no line present

Signed-off-by: Marco Marinello's avatarMarco Marinello <mmarinello@sezf.it>
parent 4104a686
......@@ -55,6 +55,30 @@ rootDisk="/dev/$diskVar"
mountPoint="/mnt"
computerList="/home/partimag/computerList.txt"
macAddress=$(getNetStuff 2)
if ! grep $macAddress $computerList; then
dialog --title "FUSS FUCC" --msgbox "Hi,\nunfortunatley, there is no valid configuration to setup this computer. Please go through the next few steps to configure how to install this PC.\nPlease make sure that the file /home/clonezilla/computerList.txt is owned and writable by clonezilla, otherwise we'll not be able to save the informations you're going to enter." 13 70
hostname=$(dialog --title "FUSS FUCC" --inputbox "Please, pick an HOSTNAME for this PC" --output-fd 1 10 70)
images=$(ls -1 /home/partimag|nl)
_img=$(dialog --title "FUSS FUCC" --output-fd 1 --menu 10 70 0 $images)
img=$(ls -1 /home/partimag | sed -n "${_img}p")
dialog --title "FUSS FUCC" --msgbox "Set image $img" 13 70
if dialog --title "FUSS FUCC" --yesno "Join this client to the domain?" ; then
join="join"
else
join="no"
fi
cluster=$(dialog --title "FUSS FUCC" --inputbox "Please, pick a CLUSTER for this PC" --output-fd 1 10 70)
if dialog --title "FUSS FUCC" --yesno "Hostname: $hostname \nMAC: $macAddress \nImage: $img \nJoin: $join \nCluster: $cluster \nContinue?" 13 70; then
echo $hostname $macAddress $img $join $cluster >> $computerList
dialog --title "FUSS FUCC" --msgbox "Configuration completed, now start cloning." 13 70
else
dialog --title "FUSS FUCC" --msgbox "Will now reboot" 13 70
reboot
exit 0
fi
fi
imageName=$(cat $computerList | grep "$macAddress" | awk '{print $3}')
ocs-sr -b -g auto -e1 auto -e2 -r -j2 -scr -p true restoredisk $imageName $diskVar
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment