Ubuntu runprogram() and Sudo

Linux specific forum
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Ubuntu runprogram() and Sudo

Post 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 :?
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post 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
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Post Reply