Comments on: Mac Servify autostart tip spotify remote Sat, 29 Sep 2012 14:51:16 +0000 hourly 1 By: Vidar Sat, 29 Sep 2012 14:51:16 +0000 Thanks for the tip on expect.
I have now changed my AppleScript to run this line:

do shell script “cd /Applications/Servify; expect start-servify.expect >/dev/null 2>&1 &”

and created the file start-servify.expect like this:

spawn mono Servify.exe
expect {*Username:*}
send my-user-name\r
expect {*Password:*}
send my-password\r
expect {*Use defaults?*:*}
send n\r
expect {*ListenPort:*}
send 1337\r
expect {*Bitrate*:*}
send 320\r
set timeout -1
expect timeout

Seems to work fine. Now locking down access to start-servify.expect should provide enough security.

By: johannes Sun, 12 Feb 2012 19:57:39 +0000 In reply to Matt.

there is a linux tool called “expect” which you might be able to use (not really sure here). There has also been support for loading credentials from a file: “mono Servify.exe login.txt” where login.txt has following layout:

By: Matt Wed, 08 Feb 2012 06:42:17 +0000 johannes-

I am setting up custom scripts to start and kill servify because it hangs in the shell if an error occurs and requires a kill pid.

I was wondering if theres a way to make this apple script run the mono servify.exe first, then supply the login details. Currently it runs the process with a pid that includes your login information in plain sight whereas the manual route only shows “mono servify.exe”. its a bit of a security risk.

do you know how to tailor this script to run a bit more like the manual start/connect process?