Page 1 of 1

Ubuntu runprogram() and Sudo

Posted: Mon Jul 27, 2009 10:44 am
by dobro
I seek to run a command through RunProgram

but this command must be done in the "sudo"
my problem is to transmit it to the
since just after a sudo, Linux pass the request

I do this

Code: Select all

Compiler = RunProgram("sudo airmon-ng", "start "+carte$, "", #PB_Program_Open|#PB_Program_Read)
   Debug ReadProgramString(Compiler)
  WriteProgramStringN(Compiler, "pass")
but it does not:?
**************************************************************************************************
**************************************************************************************************

in french :)
je cherche a lancer une commande par le biais de RunProgram

mais cette commande doit se faire en "Sudo"
mon problem c'est de transmettre le pass a la commande
puisque juste apres un sudo, Linux demande le pass

je fais ça

Code: Select all

Compiler = RunProgram("sudo airmon-ng", "start "+carte$, "", #PB_Program_Open|#PB_Program_Read)
   Debug ReadProgramString(Compiler)
  WriteProgramStringN(Compiler, "pass")
mais ça marche pas :?

Posted: Tue Jul 28, 2009 10:03 am
by lexvictory
because airmon-ng is a parameter to sudo.

Code: Select all

Compiler = RunProgram("sudo", "airmon-ng start "+carte$, "", #PB_Program_Open|#PB_Program_Read) 
should work