Koozali.org: home of the SME Server

Creating a shell script to make life easier in sme server

Offline animare

  • *
  • 29
  • +0/-0
Creating a shell script to make life easier in sme server
« on: May 16, 2012, 11:50:15 PM »
Everytime I need to provision an ibay to work with drupal I need to run the following commands:

How would I write a script that I could run (maybe as an alias) to allow me to automatically do this. I can see that the only variable is ibayname. And I want the script to ask me to input the ibayname. I'm sure this is simple but I cannot figure out the correct way to do it.

# db accounts setprop ibayname PHPBaseDir /tmp/:/home/e-smith/files/ibays/ibayname
# db accounts setprop ibayname AllowOverride All
# db accounts setprop ibayname FollowSymLinks Yes
# signal-event ibay-modify ibayname

Thanks for any help

Offline Arnie

  • ****
  • 81
  • +0/-0
  • Old Dog, New Tricks.
Re: Creating a shell script to make life easier in sme server
« Reply #1 on: May 17, 2012, 04:20:14 AM »
Instead of getting the script to ask for the ibay name, pass the name as a commandline parameter, like this:

Code: [Select]
drupal_setup <ibayname>
In the script, substitute $1 for the ibayname. for example:

Code: [Select]
db accounts setprop $1 PHPBaseDir /tmp/:/home/e-smith/files/ibays/$1
Easy!
...