shell() and sudo

Pierre Sahores psahores at easynet.fr
Tue May 13 09:25:02 EDT 2003


Rolf Kocherhans a écrit :
> 
> How can I make the shell() function work when the shell asks for a
> password or anything else ?
> 
> I can do everything what I want with shell(), but I have not figured
> out how I can answer to a request of entering a Password !
> 
> Any one got a clue...
> 
> Cheers
> Rolf
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard

Two examples used there in production(1) and test(2) modes (Linux) :

1.- An handler that backups my PostgreSQL databases in lauching (in
localhost-mode) an application server from over the web :

on pgdumpdb
  put word 2 of line lineoffset("»",fld "lesDBs") of fld "lesDBs" into
dbtosave -- the target database name
  put "pg_dump -C -d -h localhost -O -f /usr/local/httpd/..../" &
dbtosave & ".sql" && dbtosave && ";" into fld "request"
end pgdumpdb

2.- An handler that lets Metacard speaks to a localhost driven Oracle 9i
server :

get shell(fld xxx) where fld xxx contents the only two lines as below :

su - oracle -c "sqlplus scott/tiger at first.wmax.org @#-path-#plsql8"
oracle

Hope this helps,
--
Cordialement, Pierre Sahores

Inspection académique de Seine-Saint-Denis.
Applications et bases de données WEB et VPN
Qualifier et produire l'avantage compétitif



More information about the metacard mailing list