Hi,
I am running my B4J app on a Linux board.
I am trying to run a script which will allow me to change the devices IP address to something else.
I am using the following code (not sure if this is the best way or not)..
I am connected using the B4J-Bridge, and when I run the above I get the following error in the IDE log:
Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "./run.sh" (in directory "/home/Aaron/tempjars"): error=13, Permission denied)
Any ideas on what I have done wrong ?
I am guessing it's some permissions error somewhere, but not sure where and how to allow it.
I am hoping the above will allow me to change the IP address of the server to something else. If it doesn't anyone know how to do it ?
I am running my B4J app on a Linux board.
I am trying to run a script which will allow me to change the devices IP address to something else.
I am using the following code (not sure if this is the best way or not)..
B4X:
Sub AppStart (Args() As String)
Dim Writer As TextWriter
Writer.Initialize(File.OpenOutput(File.DirApp, "run.sh", False))
Writer.WriteLine("sudo ifconfig eth0 192.168.0.34")
Writer.WriteLine("sudo ifconfig eth0 netmask 255.255.255.0")
Writer.WriteLine("sudo ifconfig eth0 broadcast 192.168.0.255")
Writer.Close
Dim shl As Shell
shl.Initialize("shl", "./run.sh", Null)
shl.WorkingDirectory = File.DirApp
shl.Run(-1)
Log("done!")
StartMessageLoop
End Sub
I am connected using the B4J-Bridge, and when I run the above I get the following error in the IDE log:
Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "./run.sh" (in directory "/home/Aaron/tempjars"): error=13, Permission denied)
Any ideas on what I have done wrong ?
I am guessing it's some permissions error somewhere, but not sure where and how to allow it.
I am hoping the above will allow me to change the IP address of the server to something else. If it doesn't anyone know how to do it ?