@tom-elliott said in Extended fog variables problem.:
@greg-plamondon it’s preferred to use curl over wget. Curl doesn’t send a user afebt natively so your curl would look something like
curl -Lkso /tmp/hinfo.sh ${web}/fog/service/hinfo.php -d “mac=$mac”
I get the same result with the above.
if I echo $web i get:
http://192.168.10.238/fog/
I changed what you had to:
curl -Lkso /tmp/hinfo.sh ${web}fog/service/hostinfo.php -d "mac=$mac"
I create a deploy debug task for a host.
I type fog at the shell.
i break out of the script after nfs is mounted.
I cd to /images/postdownloadscripts
./fog.postdownload
my fog.postdown;load looks like:
#!/bin/bash
. /usr/share/fog/lib/funcs.sh
curl -Lkso /tmp/hinfo.sh ${web}fog/service/hostinfo.php -d "mac=$mac"
. /tmp/hinfo.sh
[[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
case $osid in
5|6|7|9)
clear
[[ ! -d /ntfs ]] && mkdir -p /ntfs
getHardDisk
if [[ -z $hd ]]; then
handleError "Could not find hdd to use"
fi
getPartitions $hd
for part in $parts; do
true
done
dots "Mounting partition $part"
ntfs-3g -o force,rw $part /ntfs >/dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "Failed"
debugPause
handleError "Failed to mount $part ($0)\n Args: $*"
fi
echo "Done"
debugPause
pccompany=${hostname:2:1}
case $pccompany in
2)
. ${postdownpath}fog.log
. ${postdownpath}fog.bay_replace-files
. ${postdownpath}fog.drivers
. ${postdownpath}fog.ad
;;
5)
. ${postdownpath}fog.log
. ${postdownpath}fog.canada_replace-files
. ${postdownpath}fog.drivers
. ${postdownpath}fog.ad
;;
7)
. ${postdownpath}fog.log
. ${postdownpath}fog.jet_replace-files
. ${postdownpath}fog.drivers
. ${postdownpath}fog.ad
;;
*)
. ${postdownpath}fog.log
. ${postdownpath}fog.replace-files
. ${postdownpath}fog.drivers
. ${postdownpath}fog.ad
;;
esac
umount /ntfs
;;
*)
echo "Invalid OS"
debugPause
return
;;
esac
I then type echo $location and i get nothing…
I verified that the /tmp/hinfo.sh exists.
If i cat /tmp/hinfo.sh i get:
Cannot view from browser