diff --git a/README.md b/README.md index 3ef9a61..4ba7bf9 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,4 @@ on the server: $ ./neato_deploy.tar.gz.self $ rm neato_deploy.tar.gz.self $ rm install_neato.sh -## Run $ neato_deploy http://site.com/deployment.txt +## Run $ neato_deploy.sh http://site.com/deployment.txt diff --git a/app/neato_common.php b/app/neato_common.php index 94d45b1..66d82b6 100644 --- a/app/neato_common.php +++ b/app/neato_common.php @@ -24,6 +24,13 @@ function force_root(): void { } } +function force_normal(): void { + if (posix_getuid() === 0) { + echo 'Please run as a normal user' . PHP_EOL; + exit(1); + } +} + function shasum($file) { if(file_exists($file)) { $hash = hash_file('sha256', $file, false); diff --git a/config_files/deploy_example.php b/config_files/deploy_example.php index 0b01e8d..ea08290 100644 --- a/config_files/deploy_example.php +++ b/config_files/deploy_example.php @@ -13,6 +13,8 @@ Configure::set('preinstall', [ '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'));