first of all - I’m no dev or scripter. Additionally I’m not an english nativ speaker.
So please be patient with me
I’ve got an unRAID server running a gaming VM. Due to daily demand I was looking for a easy and efficient way to start the VM and get rid of the “start safari - open unRAID web gui - logging in - start vm”-Way
After some googling I was able to “build” (just crawling infos via Google ) a simple start up script with the script editor on my mac.
And here it is …
do shell script "/usr/bin/ssh firstname.lastname@example.org virsh start Windows_10q35_5_own_vBIOS"
But after some days of using I was thinking about to make it even better - with some macOS notifications to show up when the script was started and when (or if) the VM started successfully.
But that was also the point where I need to accept, that googling can’t help me anymore due to the lack of knowledge
I did find some terminal commands that seems to be the solution - but I can’t get it into a running script. And with “I can’t” I mean, that
- I cant translate the command, which runs perfectly within terminal, into my “script” above (script editor shows me an error message but I dont know how to solve)
- I can’t combine the following commandsin a logic that a script needs to work
In my logic the script should run like the following (wrote & thought like a human - not as a dev )
START action → “ssh email@example.com virsh start Windows_10q35_5_own_vBIOS”
THEN notification → osascript -e ‘display notification “Script started” with title “Gaming VM”’
IF result = “Domain Windows_10q35_5_own_vBIOS started” (that is the feedback I get the VM was started successfully)
THEN Notification → osascript -e ‘display notification “VM started successfully” with title “Gaming VM”’
IF result = “whatever the terminal outputs when it cant start the VM”
THEN notification → osascript -e ‘display notification “VM couldn’t started” with title “Gaming VM”’
Thanks in advance for any help regarding my challenge.
Have a nice day
Model: MacMini 2018 - i7 6-Core
Browser: Safari 605.1.15
Operating System: macOS 10.14