nwhitehorn 3d4e888988 Update dialog to version 20100428. This changes the license under which
dialog is distributed from GPLv2 to LGPLv2 and introduces a number of new
features and a new and better libdialog API. The existing libdialog will
be kept temporarily as libodialog for compatibility purposes until sade,
sysinstall and tzsetup have been either updated or replaced.

__FreeBSD_version is now 900030.

Discussed on:	-current
Approved by:	core
Obtained from:	http://invisible-island.net/dialog
2011-01-12 14:55:02 +00:00

339 lines
9.2 KiB
Plaintext
Executable File

#
# ComeOn Point Functions! v0.9.2
# - usate da vari altri moduli ComeOn Point...
#
# AUTHOR: Beppe (beppe.dem@nsm.it)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
save() {
if [ -f $1 ]
then
mv $1 $1~
fi
}
# Returns $PKG_TO_REMOVE
find_incompatible_packages() {
dialog --backtitle "$TITLE" --infobox "Vediamo innanzitutto se c'e' qualche pacchetto di troppo ... ;-)" 0 0
PKG_TO_REMOVE=""
for i in sendmail smailcfg cnews
do
if [ -f /var/adm/packages/$i ]
then
PKG_TO_REMOVE="$PKG_TO_REMOVE $i"
fi
done
}
# Returns $PKG_TO_INSTALL
find_necessary_packages() {
dialog --backtitle "$TITLE" --infobox "Controlliamo se manca qualche pacchetto..." 0 0
PKG_TO_INSTALL=""
for i in tcpip mailx inn
do
if [ ! -f /var/adm/packages/$i ]
then
PKG_TO_INSTALL="$PKG_TO_INSTALL $i"
fi
done
}
# Args: user, editor
configure_trn() {
dialog --backtitle "$TITLE" --infobox "Configuro trn all'user $1..." 0 0
SHELL_USED="`basename \`cut /etc/passwd -f1,7 -d: | grep $1: | cut -f2 -d:\``"
USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $1: | cut -f2 -d:`"
TRNRC="$USER_HOME/.trnrc"
case $SHELL_USED in
bash)
if [ -f $USER_HOME/.bash_profile ]
then
PROF=$USER_HOME/.bash_profile
else
PROF=$USER_HOME/.profile
fi;;
zsh)
PROF=$USER_HOME/.zprofile;;
*)
PROF=$USER_HOME/.profile;;
esac
if [ ! -f $PROF ]
then
:>$PROF
chown $1.mail $PROF
elif [ ! "`grep -x \". ~/.trnrc\" $PROF`" ]
then
echo -e "\n. ~/.trnrc" >>$PROF
fi
save $TRNRC
echo "EDITOR=\"$2\"" > $TRNRC
cat copi.trnrc >> $TRNRC
chown $1.mail $TRNRC
}
# Args: user, editor
configure_elm() {
USER=$1
EDIT=$2
dialog --backtitle "$TITLE" --infobox "Configuro elm all'user $USER..." 0 0
USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $USER: | cut -f2 -d:`"
DIRRC="$USER_HOME/.elm"
ELMRC="$DIRRC/elmrc"
mkdir -p $DIRRC -m 700
chown $USER.mail $USERHOME $DIRRC
save $ELMRC
cat <<EOF >$ELMRC
#
# .elm/elmrc - options file for the ELM mail system
#
# Generated by $PKTNAME for $USER
#
# For yes/no settings with ?, ON means yes, OFF means no
# how to sort the alias list, "Name" by default
### aliassortby = Name
# name of editor to use for replies that have text
alteditor = $EDIT
# alternative addresses that I could receive mail from (usually a
# forwarding mailbox) and don't want to have listed...
### alternatives =
# should the default be to delete messages we've marked for deletion?
alwaysdelete = ON
# should the default be to keep unread messages in the incoming mailbox?
alwayskeep = ON
# should the default be to store read messages to the "received" folder?
alwaysstore = OFF
# should we use the "->" rather than the inverse video bar?
arrow = OFF
# should the message disposition questions be displayed(ON) or
# auto-answered(OFF) with the default answers when we resync or
# change folders?
ask = OFF
# would you like to be asked for Carbon-Copies information each msg?
askcc = OFF
# attribution string for replies ('%s' is the author of original message)
attribution = %s wrote:
# automatically copy message being replied to into buffer?
autocopy = ON
# threshold for bouncing copies of remote uucp messages...
# zero = disable function.
### bounceback = 0
# This is used to determine if the builtin pager should be used on some
# messages even if you would usually use an external pager program.
# There are two ways of determining whether the builtin pager should be
# used. If you want any message that is shorter than "n" lines to use the
# internal pager, set the parameter to "n". If you want the builtin
# pager to be used if the message is "m" lines shorter than the number of
# lines on your screen set the parameter to be "-m". Setting the
# parameter to zero will result in the message always being sent through
# your external pager.
### builtinlines = -3
# where to save calendar entries
#calendar = /root/calendar
# list of options that can be configured at the "o)ptions" screen
configoptions = ^_cdefsopyv_am_un
# Should elm always ask the user to confirm before it appends
# messages to any existing file?
# This is used for both folders in the user's mail directory
# and ordinary files.
confirmappend = OFF
# Should elm always ask the user to confirm before it creates
# any new files?
# This is used for both folders in the user's mail directory
# and ordinary files.
confirmcreate = OFF
# Should elm ask for confirmation before it appends a message
# to an existing file that is not a folder in the user's Mail
# directory?
# This is used for ordinary files only and does not affect
# folders in the user's mail directory.
confirmfiles = OFF
# Should elm ask for confirmation before it creates a new folder
# in the user's Mail directory?
# This is used only for folders in the user's mail directory and
# does not affect ordinary files.
confirmfolders = OFF
# save a copy of all outbound messages?
copy = ON
# name of editor for ~e command (when editor="builtin")
easyeditor = $EDIT
# what editor to use ("none" means simulate Berkeley Mail)
editor = $EDIT
# the character to use in the builtin editor for entering commands
### escape = ~
# save outbound messages by login name of sender/recipient even if the
# associated folder doesn't already exist?
### forcename = OFF
# do we want to be able to mail out AT&T Mail Forms?
### forms = OFF
# The full user name for outbound mail
### fullname = $PKTNAME User
# should we keep folders from which all messages are deleted?
### keepempty = OFF
# are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
### keypad = OFF
# local ".signature" file to append to appropriate messages...
localsignature = ~/.signature
# where to save my mail to, default directory is "Mail"
maildir = ~/Mail
# should we display the three-line 'mini' menu?
menu = ON
# would you like a copy of a message you send to an alias you are on?
### metoo = OFF
# when using the page commands (+ - <NEXT> <PREV>) change the current
# message pointer...?
### movepage = OFF
# just show the names when expanding aliases?
names = OFF
# when messages are copied into the outbound buffer, don't include headers?
noheader = ON
# program to use for displaying messages ('builtin' is recommended)
### pager = builtin+
# start up by pointing to the first new message received, if possible?
### pointnew = ON
# list of delivery precedences allowed, or empty to allow anything
# precedence may be followed by optional ":priority" specification
### precedences =
# prefix sequence for indenting included message text in outgoing messages...
prefix = _:>_
# how to print a message ('%s' is the filename)
### print = /bin/cat %s | /usr/bin/lpr
# prompt for a command after the external pager exits?
### promptafter = ON
# Value by which message count is incremented while reading a new mailbox.
# Setting this value to a number larger than one will speed up the time it
# takes to read a large mailbox when using a slow terminal.
### readmsginc = 1
# where to save received messages to, default file is "=received"
receivedmail = =received
# remote ".signature" file to append to appropriate messages...
remotesignature = ~/.signature
# emulate the mailx message increment mode (only increment after
# something has been 'done' to a message, either saved or deleted,
# as opposed to simply each time something is touched)?
### resolve = ON
# save messages, incoming and outbound, by login name of sender/recipient?
savename = ON
# where to save copies of outgoing mail to, default file is "=sent"
sentmail = =sent
# The shell to use for shell escapes
shell = /bin/sh
# do we want dashes above signatures? (News 2.11 compatibility and convention)
### sigdashes = ON
# time in seconds which Elm will wait after displaying a transient message
# and before erasing it. Can be 0 or positive integer.
### sleepmsg = 2
# are we running on an HP terminal and want softkeys available too?
# (this implies "keypad=ON" too)
### softkeys = OFF
# how to sort folders, "Reverse Sent" by default
### sortby = Reverse-Sent
# Set the main prompt timeout for resynching...
### timeout = 600
# display message title when displaying pages of message?
titles = ON
# where to place temporary files, default directory is "/tmp"
### tmpdir = /tmp/
# are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
userlevel = 0
# would you like to use termcap/terminfo ti/te entries?
usetite = ON
# name of editor for ~v command (when editor="builtin")
visualeditor = $EDIT
# enable the weedout list to be read?
### weed = ON
# what headers I DON'T want to see, ever.
weedout = "*end-of-user-headers*"
EOF
chmod 600 $ELMRC
chown $USER.mail $ELMRC
}