Server
- FOG Version: 1.5.0 RC9
- OS:
Client
Description
Hello all,
I’ve been tinkering between 1.5.0 RC7 - RC9 and noticed that my custom fog.man.reg file no longer works on RC9. It works fine on RC7 but after going to RC9 the postinitscript works it’s just my custom fog.man.reg file no longer operates like it use to.
https://forums.fogproject.org/topic/9851/custom-full-host-registration-menu-for-1-4-0-rc2-and-later
I posted this some time ago and doesn’t look like it works. Has the fog.man.reg file changed in RC9 vs RC7?
I suspect it has to do with the following part of the code in fog.man.reg:
setIDs() {
local varVar="$1"
local str="$2"
local csvstyle="$3"
local dummy="$4"
local max="$5"
local res=""
local url=""
local oIFS=$IFS
local line=""
while [[ -z ${!varVar} ]]; do
[[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n " Enter the $str IDs separated with , to associate with computer (? for listing): " || echo -n " Enter the $str ID to associate with computer (? for listing): "
read dummy
dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
case $dummy in
[?])
url="http://${web}service/${str}listing.php"
clearScreen
res=$(echo -e $(curl -ks $url 2>/dev/null))
i=0
IFS=$'\n'
for line in $res; do
let i+=1
echo $line
if [[ $i -eq $max ]]; then
[[ $csvstyle =~ [Tt][Rr][Uu][Ee] ]] && echo -n " Press [Enter] to proceed or enter the $str IDs separated with , to associate with computer: " || echo -n " Press [Enter] to proceed or enter the $str ID to associate with computer: "
read dummy
case $dummy in
[?]|"")
i=0
clearScreen
continue
;;
esac
case $csvstyle in
[Tt][Rr][Uu][Ee])
[[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
break
;;
*)
[[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
break
;;
esac
i=0
dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
clearScreen
fi
done
;;
""|0)
printf -v "$varVar" 0
;;
*)
dummy=$(echo $dummy | sed -e 's/^,//' -e 's/,$//')
[[ -z $dummy ]] && setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
case $csvstyle in
[Tt][Rr][Uu][Ee])
[[ $dummy =~ ^[0-9,]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy) || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
;;
*)
[[ $dummy =~ ^[0-9]+$ ]] && printf -v "$varVar" $(checkAndSet $dummy "true") || setIDs "$varVar" "$str" "$csvstyle" "$dummy" "$max"
;;
esac
;;
esac
done
IFS=$oIFS
}
When I go to enter ? to list the image ID’s the response I get is blank with the same question being asked as if nothing exists even though I have images on the server. This also goes for the location plug in where it asks for the location ID. Is there a different way to handle this now? Should I be patching a different file with the postinscripts in RC9 instead of the fog.man.reg? Thank you.