#2017 executable for changing scheduler password in the storageServer added.
This commit is contained in:
parent
e6f13e1e64
commit
4ea731e572
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/php
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Change password for the scheduler account in storageServer
|
||||
*
|
||||
* required command line parameters:
|
||||
* @param 1. scheduler password
|
||||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__).'/../var/conf.php';
|
||||
require_once dirname(__FILE__).'/../var/BasicStor.php';
|
||||
include_once 'DB.php';
|
||||
|
||||
if(trim(`whoami`) != 'root') {
|
||||
die("Please run this script as root.\n");
|
||||
}
|
||||
|
||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$dbc = DB::connect($config['dsn'], TRUE);
|
||||
if (DB::isError($dbc)) {
|
||||
die($dbc->getMessage());
|
||||
}
|
||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
$bs = new BasicStor($dbc, $config);
|
||||
|
||||
$pass = $argv[1];
|
||||
$r = $bs->passwd('scheduler', NULL, $pass);
|
||||
if (PEAR::isError($r)) {
|
||||
die($r->getMessage());
|
||||
}
|
||||
exit(0);
|
||||
?>
|
Loading…
Reference in New Issue