1
0
Files
irix-657m-src/irix/cmd/diskless/client_setup
2022-09-29 17:59:04 +03:00

105 lines
2.1 KiB
Perl

#!/usr/bin/perl
#
# This will help create a client.dat file
#
# $Revision: 1.8 $
#
#
require 5.003;
require (".dl_setup"); #Include file with functions
local (*data);
#Assert usage
if (scalar@ARGV != 0)
{
print STDERR "Usage: client_setup\n";
exit(1);
}
# Get supported platform information for .dl_classes
# It stores the array in an array of hashes
get_arch();
system(clear);
print "This program will help you create a client tree configuration file for the\n client you would ";
print "like to install.\n\n\n";
pick_info();
print "\nSpecify a size in MB for swap.\n";
again:
print "Swap size (Default is 64m - <Enter> for default):";
chomp($choice = <STDIN>);
#Check if swap is NULL or is all numbers
$_ = $choice;
if (($choice eq "") || (!(/\D+/)))
{
if ($choice ne "")
{
$SWAP = $choice;
}
else
{
$SWAP = "64";
}
}
else
{
print "\a$choice is invalid\n";
goto again;
}
if ($SWAP ne "")
{
$SWAP .= "m";
}
print "Enter your NIS domain name (hit <Enter> for no domainname): ";
chomp($choice = <STDIN>);
$NISDOMAIN = $choice;
a:
print "Specify a name for your client tree configuration file (no extension \nplease): ";
chomp($choice = <STDIN>);
$choice .= ".dat";
if ( -e $choice )
{
print "$choice exists: Overwrite (y/n)? ";
eb:
chomp($c = <STDIN>);
if ($c eq "y")
{
goto ok;
}
elsif ($c eq "n")
{
goto a;
}
else
{
print "\aPlease enter y or n: ";
goto eb;
}
}
ok:
print "Creating file $choice\n";
open (OUT,">$choice") || die "client_setup: Cannot create $choice - $!\n";
print OUT "# Created by client_setup script!\n#\n";
print OUT "CLROOT=\"\$DISKLESS\/client\/\$HOST\"\n";
print OUT "SWAP=\"\$DISKLESS\/swap\/\$HOST\"\n";
print OUT "NISDOMAIN=\"$NISDOMAIN\"\n";
print OUT "SWAPSIZE=\"$SWAP\"\n";
print OUT "\n#Client architecture information\n";
print OUT "CPUBOARD=\"$CPUBOARD\"\n";
print OUT "CPUARCH=\"$CPUARCH\"\n";
print OUT "GFXBOARD=\"$GFXBOARD\"\n";
print OUT "VIDEO=\"$VIDEO\"\n";
print OUT "MODE=\"$MODE\"\n";
close OUT;