#2017 executable for changing scheduler password in the storageServer added.
This commit is contained in:
parent
e6f13e1e64
commit
4ea731e572
1 changed files with 35 additions and 0 deletions
35
campcaster/src/modules/storageServer/bin/changeSchedulerPassword.php
Executable file
35
campcaster/src/modules/storageServer/bin/changeSchedulerPassword.php
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue