I use a linux pre-installation environment to image workstations with Windows XP. This deployment product is Symantec's Altiris Deployment Solution. We are trying to build an automated installer that asks the tech questions, which will be inserted into the sysprep of the Windows system. We are trying to build DVD disks that will image for places without direct access to an altiris server.
And have a working way to drop down my image, which is good. What's bad is how built-in scripts are handled vs. typed commands...
To "make sure" these scripts would work, I created them after booting to the Linux environment from a Linux Managed altiris environment. Ran the scripts and they worked, just fine... so I committed them to the boot disk.
I get odd errors when trying to run the exact same scripts that I verified working by typing them in manually.
Here's an example of code from my script that is completely bombing out. This information is important because we manually modify our sysprep file when imaging (we have 5 domains and potential domain admins for joining):
Code:
#!/bin/bash
read -p "Enter DOMAIN to join " SNDOMAIN
read -p "Enter ADMIN USERID " SNUSER
read -p "Enter ADMIN PASSWORD " SNPASS
mkdir /dstemp
cat /mnt/atrsboot/sysprep.inf > /dstemp/xpprep.live
sed -e "s/SNDOMAIN/$SNDOMAIN/g" -i /dstemp/xpprep.live
sed -e "s/SNUSER/$SNUSER/g" -i /dstemp/xpprep.live
sed -e "s/SNPASS/$SNPASS/g" -i /dstemp/xpprep.live
/mnt/atrsboot/firm copy "/dstemp/xpprep.live" "prod:/Sysprep/sysprep.inf"
When testing this, as typed, the script would take the variables SNDOMAIN, SNUSER, and SNPASS and use sed to replace variables in the sysprep file, then it would insert the sysprep into the newly imaged system. I know this is a long post so I'll reiterate...
the script worked FINE when typing the commands in manually.
Problem is, I'm getting errors that would hint towards a command interpreter or keyboard error... errors such as: (I've bolded manual input)
Code:
Enter DOMAIN to join mydomain.com
': not a valid identifier line 2: read: 'SNDOMAIN
Enter ADMIN USERID gnujoshua
': not a valid identifier line 3: read: 'SNUSER
Any clues are more than welcome... I've tried placing quotes around the variables "just in case", exact same result. I've also used the following:
Code:
echo "Please enter DOMAIN "
read SNDOMAIN
With the same result...