Is there a chance to call different shell commands for different conditions?

Asked by Robert Waniek

I tried to make my phone call a shell command when connecting to the SSID of my home wireless network.
After that I added a second entry making the phone call another command when disconnecting.
While double checking that I make no typing mistakes I saw that the command of the first condition changed to the second call.

Digging a bit deeper I saw that there is only one line in the sqlite database for calling a shell command.

A quite&dirty workaround might be, to change the generated shell script manually.

Is there a better way?

Question information

Language:
English Edit question
Status:
Solved
For:
touchrules Edit question
Assignee:
No assignee Edit question
Solved by:
Peter Sasse
Solved:
Last query:
Last reply:
Revision history for this message
Peter Sasse (psasse) said :
#1

Hi Robert,

could be a bug in touchrules...
May I ask you to put both commands in here? Thanks for your efforts!

With regards,
Peter

Revision history for this message
Best Peter Sasse (psasse) said :
#2

Hi Robert,

I was too fast! It is a feature not a bug... :-)
I looked into the code and found, that I need to open up the database schema for this new feature/change.
May I put you off till I find time to implement this feature "being able to specify more than one command (and more than one http request same)"?

But you may file a whishlist item (under bugs), if you like.

With kind regards,
Peter

Revision history for this message
Robert Waniek (robert-waniek) said :
#3

If it helps, I'll gladly file this wishlist item.

-------------

One more thing: Taking the script generated by the app, do you see a chance to modify it to achieve different shell calls?
I'm not very familiar with the content but I like to work my way in if it might lead somewhere.

-------------

Additional information on the background of my question:
I want my phone to start the sshd when I connect to my home wifi and stop the sshd when leaving it.
The security reason might be obvious since the device PIN is used as password for the phablet user reachable via ssh.
This opens an easy attack vector, I don't want to risk on any network but my own.

Revision history for this message
Robert Waniek (robert-waniek) said :
#4

Thanks Peter Sasse, that solved my question.