note 57525 modified in function.popen by danbrown
| From: | danbrown@php.net | Date: | Mon, 02 Mar 2009 13:37:06 +0000 |
| Subject: | note 57525 modified in function.popen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151330@lists.php.net to get a copy of this message | ||
Writing and executing a bash script is as simple as that:
<?php
$f = popen ("/bin/bash","w");
fwrite($f, "export KRB5CCNAME=
tempfile\n");
fwrite($f, "export KRBTKFILE=tempfile\n");
fwrite($f, "$KINIT --keytab=$GLOBALS["KADMIN_KEYFILE"] --use-keytab --afslog
$GLOBALS["KADMIN_PRINC"]\n");
fwrite($f, "pts delete $uid\n");
fwrite($f, "fs rmmount $rwhome\n");
fwrite($f, "vos remove sanjo b user.$uid\n");
fwrite($f, "$KDESTROY\n");
pclose($f);
?>
--was--
Writing and executing a bash script is as simple as that:
$f = popen ("/bin/bash","w");
fwrite($f, "export KRB5CCNAME=tempfile\n");
fwrite($f, "export KRBTKFILE=tempfile\n");
fwrite($f, "$KINIT --keytab=$GLOBALS["KADMIN_KEYFILE"] --use-keytab --afslog
$GLOBALS["KADMIN_PRINC"]\n");
fwrite($f, "pts delete $uid\n");
fwrite($f, "fs rmmount $rwhome\n");
fwrite($f, "vos remove sanjo b user.$uid\n");
fwrite($f, "$KDESTROY\n");
pclose($f);
http://php.net/manual/en/function.popen.php