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.
50 lines
1.5 KiB
50 lines
1.5 KiB
<?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)]);
|
|
|
|
$templates_dir = $cwd . '/templates/' . $os['name'] . '/';
|
|
|
|
Configure::set('preinstall', [
|
|
'cp' => [ 'neato.php' => 'cool.junk', 'cool.junk' => 'more.junk', '/home/bob/Documents/Servers/ha.conf' => 'test.ini' ],
|
|
'mv' => [ 'more.junk' => 'mmm.junk' ],
|
|
'rm' => [ 'cool.junk' ],
|
|
'sed' => [ 'test.ini' => [ 'timeout' => '30', 'keep_alive_setting' => '15' ] ]
|
|
]);
|
|
|
|
force_normal();
|
|
|
|
//run_once(); // only allow, this script, to run once!
|
|
|
|
$root_password = make_password(Configure::get('passwords', 'length'));
|
|
|
|
//do_command('service', 'mysql', 'stop');
|
|
|
|
/*
|
|
cp(source, dest); // Copy
|
|
ln(source_file, newlink); // make Symbloic Link
|
|
mv(old, new); // Move, rename file/dir
|
|
rm(file); // delete, unlink, Remove file/dir
|
|
make_dir(new_folder); // mkdir, create folder
|
|
append_to_file($file, $data);
|
|
$data = read_file($file); // Reads contents of a file
|
|
*/
|
|
|
|
//file_loop(Configure::get('preinstall'));
|
|
|
|
//do_command('apache::ht_password', 'my.htpasswd', 'johnny', $root_password);
|
|
|
|
$ret = do_command('is_installed', 'sed');
|
|
if ($ret['installed'] === true) {
|
|
if (version_compare($ret['version'], '4.2.1', '>=')) {
|
|
echo 'sed - Already up to date';
|
|
} else {
|
|
echo 'sed - Not up to date yet';
|
|
}
|
|
} else {
|
|
echo 'sed - Not installed!';
|
|
}
|
|
echo PHP_EOL;
|
|
|
|
display(getTermColors("Root Password: ", ['color'=>'blue']) . getTermColors($root_password, ['color'=>'green', 'style'=>'bold']) ); |