If you need to receive the sms on your local computer, and wish to create a new node on your production server using ssh rather than web APIs, then I would recommend that you do this with a custom Drush command that you write.
Start off by installing the drushify command on your local system (drush dl drushify
).
Define the options and arguments for your command; for example, you might want to put the contents of the sms message in the command argument (name the argument variable $body
), and specify any metadata in the options.
Next, fill in the implementation of your Drush command with your own code. This will look something like:
$node = new stdClass();
$node->type = 'my_sms_content_type'; // presumes you already made one of these with cck
node_object_prepare($node);
$node->body[$node->language][] = array('value' => $body, 'format' => 1);
$node->status = TRUE;
node_save($node);
Test the command locally with drush @mysite.dev sms-add "Test sms"
When satisfied, copy the Drush command to $HOME/.drush on the remote machine (where $HOME is the home folder of the remote user you define in your Drush alias), put a ssh public key in the appropriate .ssh directory, and run the command remotely with drush @mysite.live sms-add "Test sms"
. Be sure to run drush cc drush
when adding new Drush commands.
Your script then becomes:
for ID in "$@" ; do
drush @mysite.live sms-add "$(cat $INBOX/$ID)"
done
You might be able to replace the custom Drush command with Drush Entity. Give it a try.