You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
819 B
31 lines
819 B
<?php
|
|
Configure::set('display', true); // Show Output
|
|
Configure::set('logfile', true); // Save to log folder
|
|
Configure::set('syslog', false);
|
|
Configure::set('passwords', ['length' => rand(16, 26)]);
|
|
|
|
$root_password = make_password(Configure::get('passwords', 'length'));
|
|
|
|
Configure::set('post_actions', [
|
|
'chmod_file_or_dir' => [ $cwd . '/mysecret' => 'secret' ]
|
|
]);
|
|
|
|
//do_command('service', 'mysql', 'stop');
|
|
|
|
force_root();
|
|
|
|
$my_key = Enc::make_key_file("/etc/secrets_mysql");
|
|
|
|
$obj = new stdClass();
|
|
$obj->root = $root_password;
|
|
Enc::encode_file("mysecret", $obj, $my_key);
|
|
|
|
//$my_key = read_file("/etc/secrets_mysql");
|
|
//$o = Enc::decode_file("mysecret", $my_key);
|
|
//echo $o->root;
|
|
|
|
|
|
//write_file('mysecret', $root_password);
|
|
//file_loop(Configure::get('post_actions'));
|
|
|
|
//do_command('service', 'mysql', 'start');
|