Note this is all on Zenworks SP1 server running on netware....

Hey there, new to the community here. I am working with a company as a tech primarily in charge of pushing (not making or maintaining images and scripts).. However ive been running into an issue that has been causing me alot of hassle and eating up alot of my time. We have been using a script to partition drives based on drive size as we dont want to waste alot of the unpartitioned space that our sysprepped image uses. We may be going about this an entirely wrong way, but everyone else seems unegear to look into it, so here i am!.

The script we are using is:

echo "Type in the name of the image without .zmg: (eg. rec4001)"
read imgname
export hdsize=$(img p | grep /dev -m1 | awk '{print $6}')
read -p "Are you sure? " -n 1
if [[ $REPLY =~ ^[Yy]$ ]]
img pd-all
if [ $hdsize -lt 25000 ]; then
img pc1 NTFS 15000
img pc2 NTFS
#IF BETWEEN 25GB and 35GB set a 20GB C partition
elif [ $hdsize -gt 24999 ] && [ $hdsize -lt 35000 ]; then
img pc1 NTFS 20000
img pc2 NTFS
#IF BETWEEN 35GB and 55GB set a 30GB C partition
elif [ $hdsize -gt 34999 ] && [ $hdsize -lt 55000 ]; then
img pc1 NTFS 30000
img pc2 NTFS
#IF BETWEEN 55GB and 65GB set a 40GB C partition
elif [ $hdsize -gt 54999 ] && [ $hdsize -lt 65000 ]; then
img pc1 NTFS 40000
img pc2 NTFS
#IF BETWEEN 65GB and 85GB set a 50GB C partition
elif [ $hdsize -gt 64999 ] && [ $hdsize -lt 85000 ]; then
img pc1 NTFS 50000
img pc2 NTFS
#IF any other drive size set a 75GB C partition
img pc1 NTFS 75000
img pc2 NTFS
img pa1
img restorep $PROXYADDR //$PROXYADDR/zen/images/$imgname.zmg a1:p1
img restorep $PROXYADDR //$PROXYADDR/zen/images/$imgname.zmg a2:p2

Now the script itsels basically works in terms of pushing down the image, however SOMETIMES it will break the MBR or Bootsector (one would assume bootsector). I ran windows recovery on one it broke and ran bot fixmbr and fixboot and it started fine so it is one or the other and i can test next bad one if need be. First the script breaks this... it also essentially images the machine twice as it pushes the image to each partiton. Everyone seems to love this script but i am not one of those people hah....

Is there an easy way to fix this script, or is there a method our server admins just arent bothering to implement that we should be using. Either way let me know any input is appreciated! Thanks

p.s. i have two servers i have access to do as i want that i use for my own imaging on the job so i can test any new scripts or methods on them.