2 # $Id: copismall,v 1.8 2010/01/13 10:26:52 tom Exp $
4 # ComeOn Point Installer! v0.9a.small (small version for cdialog v0.9a)
5 # - installa il point in modo visuale e auto-detecting. Versione light.
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.
24 # THIS IS NOT THE ORIGINAL VERSION!!!! This files was adequate to be
25 # a demo for cdialog v0.9a+. However it doesn't include all its features.
26 # Look for one of the free ComeOn Linux! tools to have a complete
27 # demo of cdialog. ComeOn Linux! follows the GNU philosophy.
28 # Send peacefully a mail to demarco_p@abramo.it for more info.
32 #COMEONDIR=/usr/lib/ComeOn
33 #POINTDIR=$COMEONDIR/point
36 AKASETUP=$POINTDIR/.akasetup
37 PNTSETUP=$POINTDIR/.pntsetup
38 EMSIFILE=$POINTDIR/.emsi
39 COPIUSER=$POINTDIR/.copi.user
41 TITLE="ComeOn Point Installer! $COPIVER -+- (c) 1996 ComeOn Linux!"
44 #FUNCSDIR=$POINTDIR/funcs-$FUNCSVER
45 FUNCSDIR=$POINTDIR/copifuncs
47 #COPIDIR=$POINTDIR/copi-$COPIVER
48 #. $COPIDIR/copishellvars
50 #POINTVER="v1.1" # ComeOn Point version
52 if [ $LOGNAME != root ]
54 $DIALOG --backtitle "$TITLE" --title "Error!" --beep --msgbox "Questo programma per funzionare correttamente deve essere avviato dall'amministratore di sistema (root)." 0 0
59 $DIALOG --backtitle "$TITLE" --title "Are you sure?" --cr-wrap --msgbox "Questo installer procedera' in modalita'
60 auto-detect all'installazione del point.
61 Premi <Enter> per iniziare o <Esc> per uscire. " 0 0
63 if [ $? = $DIALOG_CANCEL -o $? = $DIALOG_ESC ]; then
68 pushd $FUNCSDIR >/dev/null
73 ###############################################################################
74 find_incompatible_packages
76 if [ "$PKG_TO_REMOVE" ]
78 $DIALOG --backtitle "$TITLE" --beep --title "Problem detected" --msgbox "Attenzione, prima di poter continuare bisogna avviare pkgtool e rimuovere i seguenti packages: $PKG_TO_REMOVE." 0 0
82 ###############################################################################
85 find_necessary_packages
87 if [ "$PKG_TO_INSTALL" ]
89 echo -n "Attenzione, prima di poter continuare bisogna avviare setup ed installare i seguenti packages dai disk sets N (quelli del Networking): $PKG_TO_INSTALL." >$tmp_dialog
91 if [ "`echo $PKG_TO_INSTALL | grep tcpip`" ]
93 echo -n " Ricordarsi poi di effettuare lo shutdown per rendere effettive le modifiche." >>$tmp_dialog
96 $DIALOG --backtitle "$TITLE" --beep --title "Problem detected" --msgbox "`cat $tmp_dialog`" 0 0
102 ###############################################################################
106 if [ ! -d /usr/lib/smail ]
108 $DIALOG --backtitle "$TITLE" --title "Smail not found" --inputbox "Bisogna installare Smail, per cui inserire il percorso completo di dove trovarne i binari compressi" 0 0 "/cdrom/sunsite/system/Mail/delivery/smail-linuxbin-3.1.29.1.tar.gz" 2>$tmp_smailp
109 SMAILTGZ="`cat $tmp_smailp`"
111 while [ ! -f "$SMAILTGZ" ]
113 $DIALOG --backtitle "$TITLE" --beep --title "Archive not found" --inputbox "Percorso di file \"$SMAILTGZ\" non valido, controllarne la correttezza." 0 0 "/cdrom/sunsite/system/Mail/delivery/smail-linuxbin-3.1.29.1.tar.gz" 2>$tmp_smailp
114 SMAILTGZ="`cat $tmp_smailp`"
119 ###############################################################################
127 $DIALOG --backtitle "$TITLE" --title "Primary address" --inputbox "Inserire il proprio address principale, completo di point e di domain. Il poll sara' effettuato per default dal boss corrispondente." 0 0 "2:335/722.7@fidonet" 2>$tmp_target
128 AKAFTN="`cat $tmp_target`"
130 fidonetpoint2int $AKAFTN
133 echo -n "`echo $AKA | cut -f2- -d.`:" >$tmp_asetup
134 echo -n "`echo $AKA | cut -f1 -d. | cut -c2-`:" >$tmp_psetup
139 $DIALOG --backtitle "$TITLE" --title "AKAs" --inputbox "Inserire un eventuale address secondario, oppure lasciare la riga vuota per proseguire. Attenzione: nel caso si abbiano piu' indirizzi sulla stessa rete, bisognera' configurare solo uno di questi. Gli indirizzi correntemente definiti sono: $AKASFTN" 0 0 2>$tmp_target
140 AKAFTN="`cat $tmp_target`"
144 fidonetpoint2int $AKAFTN
146 if [ "`echo $AKAS | grep \".\`echo $AKA | cut -f5 -d.\`.\"`" ]
148 $DIALOG --backtitle "$TITLE" --beep --title "Invalid address" --msgbox "Non si possono avere piu' indirizzi sullo stesso dominio (net)." 0 0
150 AKASFTN="$AKASFTN $AKAFTN"
152 echo -n "`echo $AKA | cut -f2- -d.`:" >>$tmp_asetup
153 echo -n "`echo $AKA | cut -f1 -d. | cut -c2-`:" >>$tmp_psetup
157 echo ":" >>$tmp_asetup
158 echo ":" >>$tmp_psetup
161 mv $tmp_asetup $AKASETUP
162 mv $tmp_psetup $PNTSETUP
164 ###############################################################################
167 $DIALOG --backtitle "$TITLE" --title "Hostname" --inputbox "Inserire l'hostname di questo computer qualora si abbia una rete gia' configurata, altrimenti inventarne uno fittizio da assegnare e questa macchina verra' configurata per il loopback." 0 0 "quark.comeon.org" 2>$tmp_hostnm
168 NEW_HOSTNAME="`cat $tmp_hostnm`"
171 ###############################################################################
174 $DIALOG --backtitle "$TITLE" --title "Point admin" --inputbox "Scegliere l'user principale per la gestione e l'uso del point. Se l'user non esiste, verra' creato. Se esiste, ne verranno adattate le informazioni quali nome, gruppi, etc." 0 0 "beppe" --and-widget --title "Insert SysOp's name" --inputbox "Inserire nome e cognome del gestore ed utilizzatore principale del point (il proprio nome)." 0 0 "Giuseppe De Marco" --and-widget --title "Choose editor" --inputbox "Scegliere l'editor da usare per scrivere i messaggi" 0 0 "vim" 2>$tmp_master
175 POST_USER="`cut $tmp_master -f1`"
176 POST_NAME="`cut $tmp_master -f2`"
177 POST_EDIT="`cut $tmp_master -f3`"
180 echo $POST_USER >$COPIUSER
182 ###############################################################################
186 $DIALOG --backtitle "$TITLE" --title "Origin" --inputbox "Scegliere l'Origin del sistema" 9 60 "$POST_USER's linux box" 2>$tmp_origin
187 NEW_ORIGIN="`cat $tmp_origin`"
190 $DIALOG --backtitle "$TITLE" --title "News expiring" --inputbox "Decidere per quanti giorni i messaggi echomail (le news) dovranno transitare sul sistema prima di venire cancellati automaticamente da news.daily. Inserire never se si vuole che non vengano mai cancellati. Sono ammesse cifre decimali (i.e. 25.5). Notare comunque che il valore qui inserito e' quello di default, ma per ogni singola area (newsgroup) sara' possibile specificare poi un valore appropriato." 0 0 "30" 2>$tmp_expire
191 KEEPDAYS="`cat $tmp_expire`"
194 ###############################################################################
202 if [ ! -d /usr/lib/ifmail -o ! -d /etc/ifmail -o ! -d /var/log/ifmail -o ! -f /usr/lib/ifmail/ifcico ]
204 $DIALOG --backtitle "$TITLE" --title "ifmail not found" --inputbox "Inserire il percorso COMPLETO dei sorgenti compressi di ifmail che verranno decompressi in /usr/src e compilati." 0 0 "/cdrom/sunsite/system/Mail/transport/ifmail-2.8b.tar.gz" 2>$tmp_ifmail
205 IFMAILTGZ="`cat $tmp_ifmail`"
207 while [ ! -f "$IFMAILTGZ" ]
209 $DIALOG --backtitle "$TITLE" --beep --title "invalid filename" --inputbox "Percorso di file \"$IFMAILTGZ\" non valido, controllarne la correttezza." 0 0 "/cdrom/sunsite/system/Mail/transport/ifmail-2.8b.tar.gz" 2>$tmp_ifmail
210 IFMAILTGZ="`cat $tmp_ifmail`"
214 $DIALOG --backtitle "$TITLE" --title "ifmail version" --inputbox "Specificare la versione di ifmail" 0 0 "2.8b" 2>$tmp_mailvr
215 IFMAILVERS="`cat $tmp_mailvr` + ComeOn Point $POINTVER"
221 AKA="`cut $AKASETUP -f$IAKA -d:`"
226 $DIALOG --backtitle "$TITLE" --title "Password" --inputbox "Specificare la password di sessione e per i pacchetti per il nodo $AKAFTN -- attenzione che alcuni mailers accettano solo passwords da 8 caratteri in maiuscolo!!" 0 0 "MYPASSWD" 2>$tmp_passwd
227 PASSW="$PASSW`cat $tmp_passwd`:"
230 AKA="`cut $AKASETUP -f$IAKA -d:`"
234 $DIALOG --backtitle "$TITLE" \
235 --title "Modem speed" --inputbox "Specificare la velocita' del proprio modem (che sta su /dev/modem)" 0 0 "16800" --and-widget \
236 --title "System name" --inputbox "Specificare il nome del sistema per il pacchetto EMSI" 0 0 "`cat $COPIUSER`'s linux point" --and-widget \
237 --title "Location" --inputbox "Inserire la localita' fisica in cui risiede il sistema" 0 0 "Catanzaro, Italy - Europe" --and-widget \
238 --title "Phone number" --inputbox "Inserire il proprio numero di telefono in formato internazionale, cioe' completo di doppio prefisso (xx-yyy-zzzzzz)" 0 0 "39-961-31997" --and-widget \
239 --title "International call prefix" --inputbox "Specificare il prefisso da comporre per poter effettuare una chiamata internazionale (se ci si trova in Italia ad es. bisogna inserire 00)" 0 0 "00" --and-widget \
240 --title "Long-distance call prefix" --inputbox "Specificare il prefisso da comporre per poter effettuare una chiamata interurbana in ambito nazionale, che verra' sostituito al prefisso della propria nazione quando incontrato in nodelist (per l'Italia ad es. bisogna inserire 0, che sostituira' il 39)" 0 0 "0" --and-widget \
241 --title "Pointlist flags" --inputbox "Inserire eventuali flags stile pointlist per il pacchetto EMSI" 0 0 "MO,V32B,V42B,ZYX" --and-widget \
242 --title "Modem dialing" --inputbox "Inserire la stringa da inviare al modem per comporre un numero telefonico" 0 0 "ATDT" 2>$tmp_dialer
244 echo -en "\t$POST_NAME\t\t" >>$tmp_dialer
246 mv $tmp_dialer $EMSIFILE
248 ###############################################################################
252 SMAILCFGDIR=/etc/smail
254 SMAILCFGDIR=/usr/lib/smail
257 ###############################################################################
259 $DIALOG --backtitle "$TITLE" --title "First step completed!" --msgbox "OK, ora ho tutte le informazioni necessarie per poter installare il point. Da qui in poi faro' tutto da solo, quindi ci si puo' tranquillamente andare a prendere un caffe'. :-)" 0 0
261 ###############################################################################
263 killall sendmail 2>/dev/null
264 if [ $SMAILTGZ ]; then tar zxvf $SMAILTGZ -C / >/dev/null; fi
265 /usr/sbin/sendmail -bd -q15m
267 if [ ! "`ping -c1 $NEW_HOSTNAME | grep \"1 packets received\"`" ]; then
268 configure_loopback $NEW_HOSTNAME
271 add_postmaster "$POST_USER" "$POST_NAME"
272 add_alias "$POST_NAME" "$POST_USER"
273 configure_trn "$POST_USER" "$POST_EDIT"
274 configure_elm "$POST_USER" "$POST_EDIT"
276 comment_nntp_in_inetdconf
277 set_organization "$NEW_ORIGIN"
278 create_innconf_newsfeeds_distrib
279 create_expirectl $KEEPDAYS
282 create_dirs_and_files
285 if [ $IFMAILTGZ ]; then
286 install_ifmail "$IFMAILTGZ" /usr/lib/ifmail /etc/ifmail /var/log/ifmail "$IFMAILVERS" /usr/src
288 configure_ifmail /usr/lib/ifmail /etc/ifmail /var/log/ifmail "$PASSW"
289 configure_smail $SMAILCFGDIR
291 ###############################################################################
292 $DIALOG --backtitle "$TITLE" \
293 --title "-=[ Enjoy! ]=-" --msgbox "Il point e' stato installato con successo!" 0 0 --and-widget \
294 --msgbox "trn (il newsreader, per leggere/scrivere gli echomail) ed elm (il mailreader, per leggere/scrivere i netmail) sono gia' stati configurati per l'user $POST_USER." 0 0