5 |
|
|
6 |
die "need to run $0 as root like this\nsudo $0\n" unless $< == 0; |
die "need to run $0 as root like this\nsudo $0\n" unless $< == 0; |
7 |
|
|
8 |
|
our $tftp_dir; |
9 |
sub tftp_dir { |
sub tftp_dir { |
10 |
my $dir = 'conf/' . readlink('conf/tftp.dir'); |
require 'config.pl'; |
11 |
$dir =~ s{[^/]+/\.\./([^/]+)}{$1}; |
warn "# config: ", readlink 'config.pl', " tftp_dir: $tftp_dir\n"; |
12 |
return $dir; |
return $tftp_dir; |
13 |
} |
} |
14 |
|
|
15 |
my $tftp_dir = tftp_dir; |
tftp_dir; |
16 |
|
|
17 |
die "no $tftp_dir\n" unless -e $tftp_dir; |
die "no $tftp_dir\n" unless -e $tftp_dir; |
18 |
|
|