Bringing back an old question(because these config things in bash are driving me nuts):
I have the following code in ipsecconfv2.sh
ipsecconfv2(){
$path=$1
companyname=$2;
cat>$path<<EOT
config setup
interfaces=%defaultroute
klipsdebug=none
plutodebug=none
plutoload=%search
plutostart=%search
uniqueids=yes
conn %default
keyingtries=0
compress=yes
disablearrivalcheck=no
authby=rasasig
leftrsasigkey=%cert
rightrsasigkey=%cert
left=%defaultroute
leftcert=$companyname-pub.pem
leftupdown=/usr/local/lib/ipsec/vista_updown
pfs=yes
EOT;
}
And then from createhost3.php, I have this code:
$cmd = <<<EOS
sh ipsecconfv2.sh /etc/ipsec.conf "$arg2"
EOS;
$ret = exec($cmd, $output, $retval);
Now its supposed to create /etc/ipsec.conf file but its not doing so. Am I calling the routine in the file wrong or is the whole routine just wrong?