diff options
| author | fukachan <fukachan> | 2003-01-29 14:22:53 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-01-29 14:22:53 +0000 |
| commit | 83a495a48d67eb561d86b52fec830c2a4d7d65cf (patch) | |
| tree | 7421ca6ed81e8ac7fe37928cd8edb04fe3608755 /install.pl.in | |
| parent | e8e96b6bcbf918860b423e0ba6d059ad3a864207 (diff) | |
| download | fml8-83a495a48d67eb561d86b52fec830c2a4d7d65cf.tar.gz fml8-83a495a48d67eb561d86b52fec830c2a4d7d65cf.tar.bz2 fml8-83a495a48d67eb561d86b52fec830c2a4d7d65cf.zip | |
check if we runs as root.
Diffstat (limited to 'install.pl.in')
| -rwxr-xr-x | install.pl.in | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/install.pl.in b/install.pl.in index a217bfc3..eb30fc57 100755 --- a/install.pl.in +++ b/install.pl.in @@ -5,7 +5,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: install.pl.in,v 1.1 2003/01/28 04:16:16 fukachan Exp $ +# $FML: install.pl.in,v 1.2 2003/01/29 13:58:10 fukachan Exp $ # use strict; @@ -64,23 +64,28 @@ sub _install $installer->is_valid_owner( $config->{ owner } ); $installer->is_valid_group( $config->{ group } ); - $installer->install_main_cf(); - $installer->install_sample_cf_files(); - $installer->install_default_config_files(); - $installer->install_mtree_dir(); - $installer->install_lib_dir(); - $installer->install_libexec_dir(); - $installer->install_data_dir(); - - # install programs hereafter. - $installer->install_bin_programs(); - - # update loader. - if ( $installer->need_resymlink_loader() ) { - $installer->install_loader(); - $installer->resymlink_loader(); - } + if ($installer->is_run_as_root()) { + $installer->install_main_cf(); + $installer->install_sample_cf_files(); + $installer->install_default_config_files(); + $installer->install_mtree_dir(); + $installer->install_lib_dir(); + $installer->install_libexec_dir(); + $installer->install_data_dir(); + + # install programs hereafter. + $installer->install_bin_programs(); + + # update loader. + if ( $installer->need_resymlink_loader() ) { + $installer->install_loader(); + $installer->resymlink_loader(); + } - # set up ml_spool_dir such as /var/spool/ml if needed. - $installer->setup_ml_spool_dir(); + # set up ml_spool_dir such as /var/spool/ml if needed. + $installer->setup_ml_spool_dir(); + } + else { + croak("Error: run $0 as root.\n"); + } } |
