I'm not sure what I'm doing wrong but so long as the shebang line is there and the chood x+ filename it should work?
As for the conditionals...I'm basically trying to automate the process of setting up my server the way I needed it done...
I would like to use conditionals though for case where I am setting up local servers (in which case ssh is requierd to be installed and phpMyAdmin is a likely hood as well).
Something like:
Code: Select all
apt-get install php5 php5-cli php5-curl php5-imap php5-mcrypt apache2 mysql-server
$IF %args == local
apt-get install phpmyadmin ssh
$FI
a2enmod rewrite php5
$IF %args == remote
echo "IMPORTANT: Remember to turn off error reporting"
Basically i want to begin recording the steps I need to take to configure a server to my requirements and ideally I eventually get it so it's entirely automatic so when I need to switch hosts or upgrade I simply invoke a shell script and then upload my PHP files, etc.
I think I just need to read up on bash scripting a little more as I cannot ese it being that difficult to check a command line argument...the syntax is just so damn cryptic. Feels like Perl.
Cheers,
Alex