Hey everyone. This is kind of a weird question, but I need ya'll to trust me.
We're going to be doing a rather large server deployment, and using the provisioning system we have in place there is no current way to just "copy" a file over to the servers. All files/scripts have to be run from the provisioning server.
Due to network constraints, the provisioning system can't run a script we need to run (requires certain network assets to complete, but as soon as we modify the network settings the provisioning system loses access to the server and can't run the script). So, I need our network configuration script to create the other script on the server in /root when it runs.
My original method was to do something along the lines of:
#network configuration statements here
#Create satellite registration script
echo <statements> > /root/satReg.sh
echo <morestatements> >> /root/satReg.sh
#restarting network services cuts connectivity with provisioning server by making new network configuration take affect
This would be fine except for the fact that echo runs into issues with if statements and other special characters (;, (), , etc), and starts spitting out errors. I tried using escape (\) characters with a number of the symbols but it doesn't look like its working. Is there any way to use echo to just spit out a bunch of text without trying to parse it for special characters?
Is there another way to use one script to spit out another, more complex script?
Any advice would really be appreciated.