1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
|
#!/usr/bin/perl
#
# Make_Config (c) 1997 Chris Church / aD! Data Systems
# v. 0.03
# psylark@netropolis.net
#-----------------------------------
################
# default values
################
$AMDIR = "/etc/adbbs/mods";
$WDIR = "/etc/adbbs/welcome";
$NDIR = "/etc/adbbs/news";
$MDIR = "/etc/adbbs/menu";
$MTOP = "/etc/adbbs/menu/mtop";
$GBFILE = "/etc/adbbs/goodbye.msg";
$FDIR = '/home/ftp/pub';
$IDIR = '/home/ftp/incoming';
$RNDIR = '/etc/adbbs/mtop';
$PASSWDF = '/etc/passwd';
$sz = '/usr/bin/sz -b';
$sx = '/usr/bin/sx -b';
$rz = '/usr/bin/rz -b';
$rx = '/usr/bin/rx -b';
$tppath = "/usr/bin/tput";
$hostrt = "chao";
$hostend = "ad.org";
$showwel = 1;
$shownews = 1;
$showmail = 1;
$u_singk = 0;
$u_ktime = 0;
$kbsec = 120;
$sllogin = 1;
$skwel = 1;
$lib_file = '/var/lib/adbbs/fildb.db';
$CF = '/var/lib/adbbs/crunch.db';
$uisr = 0;
$shfsize = 1;
$shmmsg = 1;
$ansi = 1;
$rndmtp = 0;
$ugroup = 1;
$ufil = 1;
#######################
# end defaults
#######################
print("aD!BBS Make_Config (v) 0.04\n");
print("(c) 1997-1998 Chris Church\n");
print("psylark\@netropolis.net\n");
print("Initializing\n");
open(IF, "confs/prewel");
open(OF, "> /etc/adbbs/prewel");
while(<IF>) {
print(OF);
}
close(IF); close(OF);
&full;
sub full {
print("I will now prompt you for information about a few things\n");
print("The information you enter will be used to create a file named\n");
print("/tmp/adbbs.cf.mk ; You will need to copy this file over your\n");
print("/etc/adbbs/adbbs.cf for any changes to take effect.\n");
print("You may hit enter at any prompt to accept the default.\n");
print("Do you wish to continue? [Y/n] -> ");
chomp($ent = <>);
if($ent =~ /n/i) {
print("Oh well then!\n");
exit;
}
print("Welcome directory\n");
print("This directory is where welcome.X files are stored\n");
print("This directory MUST exist!\n");
print("Default \[$WDIR\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$WDIR = $ent;
}
if(! -d $WDIR) {
print("This directory does not exist!\n");
print("Would you like me to make it for you? [Y/n] -> ");
chomp($ent = <>);
if($ent !~ /n/i) {
print("Making directory $WDIR\n");
mkdir("$WDIR",0755) || warn("Unable to mkdir $WDIR -> $!\n");
}
}
print("News directory\n");
print("This directory is where news.X files are stored\n");
print("This directory MUST exist!\n");
print("Default \[$NDIR\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$NDIR = $ent;
}
if(! -d $NDIR) {
print("This directory does not exist!\n");
print("Would you like me to make it for you? [Y/n] -> ");
chomp($ent = <>);
if($ent !~ /n/i) {
print("Making directory $NDIR\n");
mkdir("$NDIR",0755) || warn("Unable to mkdir $NDIR -> $!\n");
}
}
print("Menu directory\n");
print("This directory is where menu.X files are stored\n");
print("This directory MUST exist!\n");
print("Default \[$MDIR\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$MDIR = $ent;
}
if(! -d $MDIR) {
print("This directory does not exist!\n");
print("Would you like me to make it for you? [Y/n] -> ");
chomp($ent = <>);
if($ent !~ /n/i) {
print("Making directory $MDIR\n");
mkdir("$MDIR",0755) || warn("Unable to mkdir $MDIR -> $!\n");
}
}
print("Menu Top\n");
print("This is the file to be displayed above each menu\n");
print("If it does not exist, it will not be displayed\n");
print("See README File for other menu top options\n");
print("Default \[$MTOP\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$MTOP = $ent;
}
print("Goodbye File\n");
print("This is the file to be displayed when a user logs out\n");
print("If it does not exist, it will not be displayed\n");
print("Default \[$GBFILE\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$GBFILE = $ent;
}
print("File directory\n");
print("This directory is where users may view/download files\n");
print("This directory MUST exist!\n");
print("Default \[$FDIR\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$FDIR = $ent;
}
if(! -d $FDIR) {
print("This directory does not exist!\n");
print("Would you like me to make it for you? [Y/n] -> ");
chomp($ent = <>);
if($ent !~ /n/i) {
print("Making directory $FDIR\n");
mkdir("$FDIR",0755) || warn("Unable to mkdir $FDIR -> $!\n");
}
}
print("Upload directory\n");
print("This directory is where users may put files\n");
print("This directory MUST exist!\n");
print("Default \[$IDIR\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$IDIR = $ent;
}
if(! -d $IDIR) {
print("This directory does not exist!\n");
print("Would you like me to make it for you? [Y/n] -> ");
chomp($ent = <>);
if($ent !~ /n/i) {
print("Making directory $IDIR\n");
mkdir("$IDIR",0755) || warn("Unable to mkdir $IDIR -> $!\n");
}
}
print("sz\n");
print("This is the path to your 'send zmodem' program\n");
print("Default \[$sz\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$sz = $ent;
}
print("sx\n");
print("This is the path to your 'send xmodem' program\n");
print("Default \[$sx\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$sx = $ent;
}
print("rz\n");
print("This is the path to your 'receive zmodem' program\n");
print("Default \[$rz\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$rz = $ent;
}
print("rx\n");
print("This is the path to your 'receive xmodem' program\n");
print("Default \[$rx\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$rx = $ent;
}
print("tput\n");
print("This is the path to tput \(screen manipulation program\)\n");
print("This MUST Be correct\n");
print("Default \[$tppath\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$tppath = $ent;
}
print("15\) Short hostname\n");
print("This is the \(short\) hostname of your machine\n");
print("Do NOT put your domain name!\n");
print("Note: Include everything BUT your domain name, e.g.:\n");
print("chao \[or if you were bbs.chao.aD.org, you'd put bbs.chao\]\n");
print("Default \[$hostrt\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$hostrt = $ent;
}
print("16\) Domain Name\n");
print("Enter your domain name\n");
print("Default \[$hostend\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$hostend = $ent;
}
print("17\) file database file\n");
print("Enter the file to store file database in\n");
print("\[See documentation\]\n");
print("Default \[$lib_file\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$lib_file = $ent;
}
print("18\) Crunch database file\n");
print("Enter the file to store the crunch database in\n");
print("\[See documentation\]\n");
print("Default \[$CF\]\n");
print("-> ");
chomp($ent = <>);
if($ent =~ /.+/) {
$CF = $ent;
}
print("Answer the following questions with a 1 or a 0\n");
print("\[1 for true\(yes\), 0 for false\(no\)\]\n");
print("Show welcome screens? -> ");
chomp($showwel = <>);
print("Show news screens? -> ");
chomp($shownews = <>);
print("Show # of mail messages? -> ");
chomp($showmail = <>);
print("Use Single Key Entry? -> ");
chomp($u_singk = <>);
print("Show last login time? -> ");
chomp($sllogin = <>);
print("Show Skip Welcome Screen? -> ");
chomp($skwel = <>);
print("Ok, now that we've finished with all the questions,\n");
print("let's go ahead and create the configuration file\n");
print("There are many configuration options not listed by this program,\n");
print("Please read the file README for more information on configuring your BBS\n");
open(TF, "> /tmp/adbbs.cf.mk") || die("Unable to create file! -> $!\n");
print(".");
print(TF "
# adbbs.cf Created by Make_Config
# (c) 1995, 1996, 1997, 1998 Chris Church
# psylark\@netropolis.net
#------------------------------------------
\$WDIR = \"$WDIR\";
\$NDIR = \"$NDIR\";
\$MDIR = \"$MDIR\";
\$MTOP = \"$MTOP\";
\$GBFILE = \"$GBFILE\";
\$FDIR = \"$FDIR\";
\$IDIR = \"$IDIR\";
$RNDIR = \"\";
\$sz = \"$sz\";
\$sx = \"$sz\";
\$rz = \"$rz\";
\$rx = \"$rx\";
\$tppath = \"$tppath\";
\$hostrt = \"$hostrt\";
\$hostend = \"$hostend\";
\$showwel = $showwel;
\$shownews = $shownews;
\$showmail = $showmail;
\$u_singk = $u_singk;
\$u_ktime = $u_ktime;
\$kbsec = $kbsec;
\$sllogin = $sllogin;
\$skwel = $skwel;
\$lib_file = \"$lib_file\";
\$CF = \"$CF\";
\$uisr = $uisr;
\$shfsize = $shfsize;
\$shmmsg = $shmmsg;
\$ansi = $ansi;
\$rndmtp = $rndmtp;
\$ugroup = $ugroup;
\$ufil = $ufil;
1;\n");
print("All done!\n");
exit;
}
|