2 # $Id: common.funcs,v 1.2 2012/06/29 22:33:42 tom Exp $
4 # ComeOn Point Functions! v0.9.2
5 # - usate da vari altri moduli ComeOn Point...
7 # AUTHOR: Beppe (beppe.dem@nsm.it)
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 # Returns $PKG_TO_REMOVE
32 find_incompatible_packages() {
33 dialog --backtitle "$TITLE" --infobox "Vediamo innanzitutto se c'e' qualche pacchetto di troppo ... ;-)" 0 0
36 for i in sendmail smailcfg cnews
38 if [ -f /var/adm/packages/$i ]
40 PKG_TO_REMOVE="$PKG_TO_REMOVE $i"
45 # Returns $PKG_TO_INSTALL
46 find_necessary_packages() {
47 dialog --backtitle "$TITLE" --infobox "Controlliamo se manca qualche pacchetto..." 0 0
50 for i in tcpip mailx inn
52 if [ ! -f /var/adm/packages/$i ]
54 PKG_TO_INSTALL="$PKG_TO_INSTALL $i"
61 dialog --backtitle "$TITLE" --infobox "Configuro trn all'user $1..." 0 0
63 SHELL_USED="`basename \`cut /etc/passwd -f1,7 -d: | grep $1: | cut -f2 -d:\``"
64 USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $1: | cut -f2 -d:`"
65 TRNRC="$USER_HOME/.trnrc"
69 if [ -f $USER_HOME/.bash_profile ]
71 PROF=$USER_HOME/.bash_profile
73 PROF=$USER_HOME/.profile
76 PROF=$USER_HOME/.zprofile;;
78 PROF=$USER_HOME/.profile;;
85 elif [ ! "`grep -x \". ~/.trnrc\" $PROF`" ]
87 echo -e "\n. ~/.trnrc" >>$PROF
92 echo "EDITOR=\"$2\"" > $TRNRC
93 cat copi.trnrc >> $TRNRC
102 dialog --backtitle "$TITLE" --infobox "Configuro elm all'user $USER..." 0 0
104 USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $USER: | cut -f2 -d:`"
105 DIRRC="$USER_HOME/.elm"
108 mkdir -p $DIRRC -m 700
109 chown $USER.mail $USERHOME $DIRRC
115 # .elm/elmrc - options file for the ELM mail system
117 # Generated by $PKTNAME for $USER
120 # For yes/no settings with ?, ON means yes, OFF means no
122 # how to sort the alias list, "Name" by default
123 ### aliassortby = Name
125 # name of editor to use for replies that have text
128 # alternative addresses that I could receive mail from (usually a
129 # forwarding mailbox) and don't want to have listed...
132 # should the default be to delete messages we've marked for deletion?
135 # should the default be to keep unread messages in the incoming mailbox?
138 # should the default be to store read messages to the "received" folder?
141 # should we use the "->" rather than the inverse video bar?
144 # should the message disposition questions be displayed(ON) or
145 # auto-answered(OFF) with the default answers when we resync or
149 # would you like to be asked for Carbon-Copies information each msg?
152 # attribution string for replies ('%s' is the author of original message)
153 attribution = %s wrote:
155 # automatically copy message being replied to into buffer?
158 # threshold for bouncing copies of remote uucp messages...
159 # zero = disable function.
162 # This is used to determine if the builtin pager should be used on some
163 # messages even if you would usually use an external pager program.
164 # There are two ways of determining whether the builtin pager should be
165 # used. If you want any message that is shorter than "n" lines to use the
166 # internal pager, set the parameter to "n". If you want the builtin
167 # pager to be used if the message is "m" lines shorter than the number of
168 # lines on your screen set the parameter to be "-m". Setting the
169 # parameter to zero will result in the message always being sent through
170 # your external pager.
171 ### builtinlines = -3
173 # where to save calendar entries
174 #calendar = /root/calendar
176 # list of options that can be configured at the "o)ptions" screen
177 configoptions = ^_cdefsopyv_am_un
179 # Should elm always ask the user to confirm before it appends
180 # messages to any existing file?
181 # This is used for both folders in the user's mail directory
182 # and ordinary files.
185 # Should elm always ask the user to confirm before it creates
187 # This is used for both folders in the user's mail directory
188 # and ordinary files.
191 # Should elm ask for confirmation before it appends a message
192 # to an existing file that is not a folder in the user's Mail
194 # This is used for ordinary files only and does not affect
195 # folders in the user's mail directory.
198 # Should elm ask for confirmation before it creates a new folder
199 # in the user's Mail directory?
200 # This is used only for folders in the user's mail directory and
201 # does not affect ordinary files.
204 # save a copy of all outbound messages?
207 # name of editor for ~e command (when editor="builtin")
210 # what editor to use ("none" means simulate Berkeley Mail)
213 # the character to use in the builtin editor for entering commands
216 # save outbound messages by login name of sender/recipient even if the
217 # associated folder doesn't already exist?
220 # do we want to be able to mail out AT&T Mail Forms?
223 # The full user name for outbound mail
224 ### fullname = $PKTNAME User
226 # should we keep folders from which all messages are deleted?
229 # are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
232 # local ".signature" file to append to appropriate messages...
233 localsignature = ~/.signature
235 # where to save my mail to, default directory is "Mail"
238 # should we display the three-line 'mini' menu?
241 # would you like a copy of a message you send to an alias you are on?
244 # when using the page commands (+ - <NEXT> <PREV>) change the current
245 # message pointer...?
248 # just show the names when expanding aliases?
251 # when messages are copied into the outbound buffer, don't include headers?
254 # program to use for displaying messages ('builtin' is recommended)
257 # start up by pointing to the first new message received, if possible?
260 # list of delivery precedences allowed, or empty to allow anything
261 # precedence may be followed by optional ":priority" specification
264 # prefix sequence for indenting included message text in outgoing messages...
267 # how to print a message ('%s' is the filename)
268 ### print = /bin/cat %s | /usr/bin/lpr
270 # prompt for a command after the external pager exits?
273 # Value by which message count is incremented while reading a new mailbox.
274 # Setting this value to a number larger than one will speed up the time it
275 # takes to read a large mailbox when using a slow terminal.
278 # where to save received messages to, default file is "=received"
279 receivedmail = =received
281 # remote ".signature" file to append to appropriate messages...
282 remotesignature = ~/.signature
284 # emulate the mailx message increment mode (only increment after
285 # something has been 'done' to a message, either saved or deleted,
286 # as opposed to simply each time something is touched)?
289 # save messages, incoming and outbound, by login name of sender/recipient?
292 # where to save copies of outgoing mail to, default file is "=sent"
295 # The shell to use for shell escapes
298 # do we want dashes above signatures? (News 2.11 compatibility and convention)
301 # time in seconds which Elm will wait after displaying a transient message
302 # and before erasing it. Can be 0 or positive integer.
305 # are we running on an HP terminal and want softkeys available too?
306 # (this implies "keypad=ON" too)
309 # how to sort folders, "Reverse Sent" by default
310 ### sortby = Reverse-Sent
312 # Set the main prompt timeout for resynching...
315 # display message title when displaying pages of message?
318 # where to place temporary files, default directory is "/tmp"
321 # are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
324 # would you like to use termcap/terminfo ti/te entries?
327 # name of editor for ~v command (when editor="builtin")
330 # enable the weedout list to be read?
333 # what headers I DON'T want to see, ever.
334 weedout = "*end-of-user-headers*"
339 chown $USER.mail $ELMRC