|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<?php |
|
|
|
|
Configure::set('display', true); // Show Output |
|
|
|
|
Configure::set('logfile', true); // Save to log folder |
|
|
|
|
Configure::set('logfile', false); // Save to log folder |
|
|
|
|
Configure::set('syslog', false); |
|
|
|
|
Configure::set('passwords', ['length' => rand(16, 26)]); |
|
|
|
|
|
|
|
|
|
@ -10,19 +10,19 @@ Configure::set('pre_actions', [ |
|
|
|
|
[ $cwd . '/my_vaults' => 'keydir', '/etc/neato_secrets' => 'keydir' ], |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
//do_command('service', 'mysql', 'stop'); |
|
|
|
|
|
|
|
|
|
force_root(); |
|
|
|
|
|
|
|
|
|
//do_command('service', 'mysql', 'stop'); |
|
|
|
|
|
|
|
|
|
file_loop(Configure::get('pre_actions')); |
|
|
|
|
|
|
|
|
|
$my_key = Enc::make_key_file("/etc/neato_secrets/mysql_data"); |
|
|
|
|
$my_key = Enc::make_key_file("/etc/neato_secrets/mysql_key"); |
|
|
|
|
|
|
|
|
|
if (!file_exists($cwd . "/my_vaults/my_secrets")) { |
|
|
|
|
if (!file_exists($cwd . "/my_vaults/mysql_secrets")) { |
|
|
|
|
$root_password = make_password(Configure::get('passwords', 'length')); |
|
|
|
|
$obj = new stdClass(); |
|
|
|
|
$obj->root = $root_password; |
|
|
|
|
Enc::encode_file($cwd . "/my_vaults/my_secrets", $obj, $my_key); |
|
|
|
|
Enc::encode_file($cwd . "/my_vaults/mysql_secrets", $obj, $my_key); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -30,4 +30,10 @@ if (!file_exists($cwd . "/my_vaults/my_secrets")) { |
|
|
|
|
//$o = Enc::decode_file($cwd . "/my_vaults/my_secrets", $my_key); |
|
|
|
|
//echo $o->root; |
|
|
|
|
|
|
|
|
|
//do_command('service', 'mysql', 'start'); |
|
|
|
|
//do_command('service', 'mysql', 'start'); |
|
|
|
|
$ret = do_command('service', 'mysql', 'status'); |
|
|
|
|
if ($ret === 0) { |
|
|
|
|
echo "Status Running ;-)"; |
|
|
|
|
} else { |
|
|
|
|
echo "Status Not Running!"; |
|
|
|
|
} |