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
|
#! /usr/bin/perl
exit(0) if ($ARGV[0] ne 'configure');
umask(022);
# Check if the config files are in /var/lib/minicom.
# If so, move them to /etc.
if ( -f '/var/lib/minicom/minirc.dfl' ) {
print "Moving config file from /var/lib/minicom to /etc\n";
chdir('/var/lib/minicom');
system('mv * /etc');
rmdir('/var/lib/minicom');
}
if (-f '/etc/minicom.noconf') {
unlink('/etc/minicom.noconf');
# Warn the user about some things that will need configuration
print "\nroot should run minicom with the -s flag to set\n";
print "the system-wide configuration for Minicom.\n\n";
print "Users must be added to the ``dialout'' group to allow\n";
print "access to the modem device.\n\n";
print <<EOF;
Minicom can use the META (ALT) key as command key. You can specify this by
using the '-m' (meta) option to minicom or by putting it in the configuration
file. If you want to put it in the configuration file, you can _only_ use
minicom on the console, and not on a terminal or in an xterm window.
EOF
print "\nPut usage of META key in configuration file? [n] ";
$ans = <STDIN>;
if ($ans =~ m/^[yY].*/) {
open (FD, '>>/etc/minirc.dfl');
print FD "pu escape-key Escape (Meta)\n";
close FD;
print "..OK.\n";
}
}
system('/usr/bin/update-menus') if (-x '/usr/bin/update-menus');
print "Minicom configuration complete.\n";
0;
|