I’m trying to do a server management for Valentina. They use a very simple shell script to start and stop the server. I don’t want to reinvent the wheel and thought I could just execute the script with AuthorizationMBS. However, the script already calls sudo. This here is the main part of the script:
sudo -S launchctl unload /Library/LaunchDaemons/com.paradigmasoft.vserver_x64.plist
This makes the Xojo code hang. Does anyone have an idea how I can still execute the script from within Xojo?
The code is rather simple:
[code]dim StartScript as FolderItem = ServerLocation.getFolderitem
if theAuthorisation = nil then
theAuthorisation = new AuthorizationMBS
theAuthorisation.KeepRights = true
if not theAuthorisation.SimpleNewAuthorization then
Return False
end if
end if
dim s(-1) as string
theAuthorisation.Execute(StartScript.UnixpathMBS, s, true)
if theAuthorisation.LastError = 0 then
dim theResult as Integer = theAuthorisation.Wait
Return True
else
Return False
end if[/code]
Xojo 2019r3.