home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Caldera Network Desktop 1.0
/
caldera-network-desktop-1.0.bin
/
images
/
ramdisk2.img
/
usr
/
lib
/
perl
/
clock
< prev
next >
Wrap
Text File
|
1995-08-07
|
1KB
|
65 lines
# config clock and timezone -*-perl-*-
$clockmode = "";
$timezone = "";
$zoneinfodir = "/usr/lib/zoneinfo";
sub configure_clock {
local ( @zones );
if (! &rhs_menu("Clock Configuration",
<<EOM
>
Is your system clock set to local time or GMT?
>
EOM
, 50, 2,
"Local Time", "",
"GMT/UTC", "")) {
return 0;
}
if ($dialog_result eq "Local Time") {
$clockmode = "local";
} else {
$clockmode = "GMT";
}
chdir("$fsmount$zoneinfodir");
@zones = ();
open(FIND, "find . -type f -print |");
@zones = <FIND>;
close(FIND);
@zones = reverse sort grep(s/\.\///, grep(chop, @zones));
chdir("/");
if (! &rhs_menul("Time Zone",
<<EOM
>
Pick a time zone.
>
EOM
, 50, scalar(@zones), @zones)) {
return 0;
}
$timezone = $dialog_result;
unlink("$fsmount/etc/localtime");
symlink("..$zoneinfodir/$dialog_result", "$fsmount/etc/localtime");
return 1;
}
sub finish_clock {
open(FD, ">$fsmount/etc/sysconfig/clock");
print FD "CLOCKMODE=\"$clockmode\"\n";
close FD;
return 1;
}
##############################
1;