rand(16, 26)]); /** @phpstan-ignore-next-line Variable $cwd $os might not be defined */ $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' ] ] ]); forceNormal(); //run_once(); // only allow, this script, to run once! $root_password = makePassword(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')); //doCommand('apache::ht_password', 'my.htpasswd', 'johnny', $root_password); $ret = doCommand('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']) );