How to create a trigger
-
I'm wanting to use this to restart mysqld using ifttt on a server that does NOT have a GUI.
All the docs I'm reviewing state to launch a GUI to create the command.
Nothing like that in the TriggerCMD interface.Take a look at this AI generated result from Google Search:
https://www.google.com/search?q=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&oq=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQLhhA0gEJMjIwMzdqMGoxqAIAsAIA&sourceid=chrome&ie=UTF-8 -
@gigaboy, thanks for sharing that link. I'm loving the fact that Google gave you that answer - to use TRIGGERcmd via IFTTT.
If your server doesn't have a GUI, you'll have to edit your ~/.TRIGGERcmdData/commands.json file manually, using a text editor like vi (aka vim) or pico, nano etc.
On Linux, your default ~/.TRIGGERcmdData/commands.json file includes the first 5 commands. I added the 6th command you could use to restart mysql, like Google says.
[ {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"}, {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"notepad","allowParams": "false"}, {"trigger":"Calculator","command":"gnome-calculator","ground":"foreground","voice":"calculator","allowParams": "false"}, {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"}, {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"}, { "trigger": "Restart MySQL", "command": "sudo systemctl restart mysql", "offCommand": "", "ground": "background", "voice": "restart", "voiceReply": "", "allowParams": "false" } ]
Notice I made "ground" = "background" because without a GUI, you probably installed the background agent (with installdaemon.sh) which runs the TRIGGERcmd agent in background mode as service.
-
@Russ
Perfect! Thanks for your help!