⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 copi.funcs

📁 This version of dialog, formerly known as cdialog is based on the Debian package for dialog 0.9a (se
💻 FUNCS
📖 第 1 页 / 共 3 页
字号:
  save active.times    echo "control 814573260 usenet" > active.times  echo "junk 814573260 usenet" >> active.times  chown news.news active.times  save newsgroups  :>newsgroups  chown news.news newsgroups  popd >/dev/null}install_rcnews() {  dialog --backtitle "$TITLE" --infobox "Avvio l'InterNet News daemon (innd) e l'installo negli script di boot, attendere... attenzione che e' probabile che in questa fase non sia possibile entrare da un'altra VC come root." 0 0  RCLOCAL=/etc/rc.d/rc.local  RCNEWS=~news/etc/rc.news  RCLINE="`grep $RCNEWS $RCLOCAL`"  if [ ! "$RCLINE" -o `echo $RCLINE | cut -c1` = '#' ]  then    save $RCLOCAL    echo -e "\n$RCNEWS" >>$RCLOCAL  fi  cp copi.rcnews $RCNEWS  chmod 550 $RCNEWS  chown news.news $RCNEWS   if [ -f ~news/innd/innd.pid ]; then    su -l news -c "bin/ctlinnd shutdown x" >/dev/null    sleep 2	# wait for server to shutdown  fi  killall innd 2>/dev/null	# make sure it's gone down  $RCNEWS}install_crontab_news() {  dialog --backtitle "$TITLE" --infobox "Imposto la crontab di news per l'automantenimento del sistema (cancellazione giornaliera dei messaggi vecchi et similia)..." 0 0  if [ -f $COPIUSER ]; then    POSTMST="`cat $COPIUSER`"  else    POSTMST="root"  fi  NEWSHOME=~news  save /var/spool/cron/crontabs/news  cat <<EOF | crontab - -u news#-------------------------------------------------------------------------------# /var/spool/cron/crontabs/newsSHELL=/bin/sh#MAILTO=$POSTMST##===============================================================================## inn-1.4 (Inter Net News)##===============================================================================##-------------------------------------------------------------------------------# Daily housekeeping ... expires news and other things ...#-------------------------------------------------------------------------------#51 16 * * *	$NEWSHOME/bin/news.daily < /dev/null##-------------------------------------------------------------------------------# offer spooled news - that was spooled into the incoming directory when the # innd server wasn't available - again to the innd server.#-------------------------------------------------------------------------------#18 * * * *	$NEWSHOME/rnews -U# #-------------------------------------------------------------------------------# send news batches to your fidonet(-like) news feeds #-------------------------------------------------------------------------------#49 16 * * *	$NEWSHOME/send-ifmail$SENDCRON##-------------------------------------------------------------------------------#EOF  echo $NEWSHOME/send-ifmail$SENDCRON >/etc/point.ifsend}# Private func# Args: dir_with_sources, bindir, cfgdir, logdir, versioncopi.ifmCfg() {  SRCDIR="$1"  BINDIR="$2"  CFGDIR="$3"  LOGDIR="$4"  VERSION="$5"  SOURCE="$SRCDIR/CONFIG"  CONFIGFILE="$CFGDIR/config"  cat <<EOF >$SOURCE# Compile-time configuration for ifmail FidoNet mailer and gatewayCOPYRIGHT   = "Eugene G. Crosser, 1993-1995"VERSION     = "$VERSION"# Main configuration file. This default may be overwritten by -I key.CONFIGFILE  = $CONFIGFILE# Debug messages turned on by -x key are written here.# Some error messages may occationally appear here too.# This may be changed in the 'config' file.DEBUGFILE   = "$LOGDIR/ifdebug"# Procession log. Usually gets several lines for each invocation.# Also look for error diagnostics here.  If HAS_SYSLOG defined,# only stdout and stderr from the packers and unpackers go to this# file, while actual logging is done via syslog() calls.# This may be changed in the 'config' file.LOGFILE     = "$LOGDIR/iflog"# Use syslog() facility codes for mail gate, news gate and ifcico.# Define -DHAS_SYSLOG (see below)#MAILLOG    = LOG_MAILMAILLOG    = LOG_LOCAL0#NEWSLOG    = LOG_NEWSNEWSLOG    = LOG_LOCAL0#CICOLOG    = LOG_UUCPCICOLOG    = LOG_LOCAL0# Directory where UUCP lock files reside.#LOCKDIR     = "/var/lock"LOCKDIR     = "/var/spool/uucp"# Directory from which file requests are resolved.# This may be changed from the 'config' file.#PUBDIR      = "/home/ftp/pub"PUBDIR      = "/var/spool/uucppublic"# Compile-time system-dependant options. # If you specify "-DHAS_NDBM_H", ndbm calls will be used instead# of dbm ones, and the feature will be activated of Cnews log processing# to add entries to SEEN-BY if echo message is exported to several FTN# nodes by Cnews mechanism. This works with INN too.# If you specify "-DHAS_STATFS" or "-DHAS_STATVFS", statfs() (or statvfs()# respectivly) call will be used to check available disk space. For statfs()# call, you must also specify which .h file to use: "-DSTATFS_IN_VFS_H" or # "-DSTATFS_IN_STATFS_H" or "-DSTATFS_IN_STATVFS_H"  or "-DSTATFS_IN_MOUNT_H". # For statvfs() call, statvfs.h is included.# define -DSCO_STYLE_STATFS if your statfs() call requires 4 arguments.# If you specify "-DHAS_SETSID", setsid() call is used to detach from the# control terminal. Otherwise setpgrp() call is used, and in this case you# may specify "-DBSD_SETPGRP" to use BSD-style call.  Used in ifcico only.# If you specify "-DDONT_HAVE_TM_GMTOFF", timezone offset will be calculated# from the difference between the results of localtime() and gmtime() calls# instead of using tm_gmtoff field of struct tm.# If you specify "-DDONT_HAVE_GETOPT", local definitions for getopt will# be used (but not the function itself)# For ifcico, you must specify -DHAS_TERMIOS_H (preffered), -DHAS_TERMIO_H# or -DHAS_SGTTY_H to use POSIX-y, SysV-ish of BSD-ish terminal control.# in SVR4 you should specify -DHAS_DIAL (and maybe -DHAS_DIAL_H) to use# dial() library function instead of regular open().  Lock files are# not used in this case.# for uucp lock files, you must specify either -DASCII_LOCKFILES or# -DBINARY_LOCKFILES# define -DHAS_FSYNC if there is a fsync() system call (to update .flo# files)# define -DPARANOID if you want iftoss to deny packets with wrong password.# define -DRELAXED if you want iftoss to accept packets that are not# addressed to your node.# define -DFORCEINTL if you want ifmail to create ^aINTL even if this is# not an inter-zone netmail.# define -DNEED_UUCPFROM if your MTA needs a uucp "From" line in mail.# define -DHAS_TCP if you want ifmail to be able to originate outgoing# connections over TCP/IP (socket library needed)# define -DHAS_TERM if you want ifmail to be able to originate outgoing# connections over TERM (TCP "extention", client.a needed)# define -DHAS_REGEX_H or -DHAS_LIBGEN_H if you have either of these# header files for regular expression handlers.# define -DHAS_SYSLOG to use syslog() instead of logging to files.# Files are necessary anyway, external programs' stdout and stderr# are redirected there.# define -DNEED_BSY if you want ifpack and ifcico to create .bsy# files preventing simultaneous processing of the same node.# define -DNEED_FORK if your system is uncapable of getting rid of the# control terminal unless you are running not as a group leader.# define -DREGEX_NEED_CARET if your re_comp/re_exec require that the# mask starts with a '^' to match the beginning of the string.# as of June 1994, FreeBSD has a nasty bug in the kernel lseek() code:# if you make lseek() to a point before the start of the file, it# succeeds and the writing point becomes negative.  Fortunately, # subsequent write()s fail :-).  To overwork this, define # -DNEGATIVE_SEEK_BUG, this will add an extra fseek() to restore# zero writing point where necessary.# define -DNEED_TRAP if you want debugging information when the programs# are aborted with segmentation fault etc.  Currently tested and works # only with Linux, and only with newer kernels (1.1.20+)# define -DSLAVE_SENDS_NAK_TOO if you have problems answering incoming# EMSI sessions originated by FrontDoor.  FrontDoor does not follow# EMSI specifications when originating calls, this is a workaround.# define -DDONT_HAVE_DIRENT if there is no working opendir()/readdir()# etc. in your libc.  You will aso need to add "dirent.o" to the NEEDED# (see below).# Linux:OPTS        = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \\		-DDONT_HAVE_TM_GMTOFF -DHAS_TERMIOS_H -DASCII_LOCKFILES \\		-DHAS_FSYNC -DHAS_IOCTL_H -DHAS_REGEX_H -DHAS_TCP \\		-DFORCEINTL -DHAS_SYSLOG -DNEED_UUCPFROM -DNEED_BSY \\		-DREGEX_NEED_CARET -DNEED_TRAP -DSLAVE_SENDS_NAK_TOO \\		-DNEED_FORK -DLESS_RFC_KLUDGES# 386BSD:#OPTS        = -DHAS_STATFS -DSTATFS_IN_MOUNT_H -DHAS_SETSID -DHAS_NDBM_H \\		-DHAS_TERMIOS_H -DASCII_LOCKFILES -DHAS_FSYNC -DHAS_IOCTL_H \\		-DHAS_REGEX_H -DHAS_TCP -DHAS_SYSLOG -DNEED_UUCPFROM \\		-DNEED_BSY -DNEED_FORK -DNEGATIVE_SEEK_BUG \\		-DREGEX_NEED_CARET# SVR4:#OPTS        = -DHAS_STATVFS -DDONT_HAVE_TM_GMTOFF -DHAS_SETSID -DHAS_NDBM_H \\		-DHAS_TERMIOS_H -DHAS_DIAL -DHAS_DIAL_H -DASCII_LOCKFILES \\		-DHAS_FSYNC -DHAS_IOCTL_H -DHAS_LIBGEN_H -DHAS_TCP \\		-DHAS_SYSLOG -DREGEX_NEED_CARET# SunOS:#OPTS        = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \\		-DDONT_HAVE_GETOPT -DHAS_TERMIOS_H -DASCII_LOCKFILES \\		-DHAS_FSYNC -DHAS_TCP -DHAS_SYSLOG \\		-DREGEX_NEED_CARET# SCO Unix 3.2v4.2#OPTS        = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DSCO_STYLE_STATFS \\		-DHAS_TERMIOS_H -DDONT_HAVE_TM_GMTOFF -DDO_NEED_TIME \\		-DDONT_HAVE_GETOPT -DASCII_LOCKFILES -DHAS_IOCTL_H \\		-DHAS_TCP -DHAS_SYSLOG \\		-DREGEX_NEED_CARET# ISC Unix 3.2 v3.0#OPTS        = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DHAS_TERMIO_H \\		-DDONT_HAVE_TM_GMTOFF -DDONT_HAVE_GETOPT \\		-DASCII_LOCKFILES -DHAS_IOCTL_H -DSCO_STYLE_STATFS \\		-DUSE_POLL -DHAS_NET_ERRNO_H -DSHORT_PID_T \\		-DHAS_TCP -DHAS_SYSLOG \\		-DREGEX_NEED_CARET# On ISC, if you are suing gcc, you can run into a trouble with sscanf()# function.  It appears that sscanf(string,"%d.%d",&int1,&int2) where# string is a constant segfaults unless you specify "-fwritable-strings"# to gcc.  I would say that this is a bug in ISC libc.  If nessecary,# add this to the defines above.  If you have ISC version 4.0 or later,# you can add "-posix", remove "-DSHORT_PID_T" and specify "-DHAS_TERMIOS"# to get benefit of posix terminal control.# for make install, where to put binaries and what owner to setBINDIR = $BINDIROWNER = fnetGROUP = uucpMODE = 0711SMODE = 4711INSTALL = installRANLIB = ranlib#RANLIB = touchSHELL = /bin/shECHO = echo -eCC = gccYACC = bison -y#YACC = yaccLEX = flex#LEX = lexAWK = awkTAR = tar#CFLAGS = -g -Wall# Linux, 386BSD, SunOS:CFLAGS = -O2 -Wall -m486 -s# SVR4:#CFLAGS = -O -XaLDFLAGS = -s# For LIBS, you may need to add "-lfl" if you are using flex 2.4.x# If you need TERM also add e.g. "/usr/src/term112/client.a"# LinuxLIBS = -ldbm# SunOS:#LIBS =# 386BSD:#LIBS = -lgdbm -lgnuregex# SVR4#LIBS = -ldbm -lform -lnsl -lsocket -lc -L/usr/ucblib -lucb# SCO#LIBS = -ldbm -lsocket -lintl# ISC#LIBS = -lcposix -lmalloc -ldbm -linet -lPWINCLUDES = -I\${INCDIR}# ISC#INCLUDES = -I/usr/include/rpcsvc -I\${INCDIR}# What programs are absent at your system?#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o rename.o mkdir.o usleep.o \\		regexpr.o# LinuxNEEDED =# SVR4#NEEDED = regexpr.o# SCO#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o usleep.o regexpr.o# SunOS and 386BSD#NEEDED = signal.o# ISC#NEEDED = usleep.o regexpr.o vsyslog.oEOF}# Args: package.tgz, bin_dir, cfg_dir, log_dir, version, where_to_put_srcinstall_ifmail() {  dialog --backtitle "$TITLE" --infobox "Installo e compilo Ifmail..." 0 0  AKAPRI="`cut $AKASETUP -f1 -d:`"  int2fido $AKAPRI  AKAPRIFTN=$_RETVAL  if [ -f $COPIUSER ]  then    POST="`cat $COPIUSER`"  else    POST=root  fi  TGZ="$1"  BINDIR="$2"  CFGDIR="$3"  LOGDIR="$4"  VERSION="$5"  SRC="$6"##################################################### passwd e group####################################  if [ "`cut /etc/passwd -f1 -d: | grep -x fnet`" ]  then    mkstemp passwd    grep -v "fnet:" /etc/passwd >$tmp_passwd    save /etc/passwd    mv $tmp_passwd /etc/passwd  fi  find_unused_uid 92  echo "fnet:*:$FOUND_UID:14:Fidonet Gate:$BINDIR:" >>/etc/passwd######################################################## dirs and files###################################  mkdir -p        $CFGDIR $LOGDIR /var/spool/ifmail/{BAK,nl.d} $BINDIR/magic  chown fnet.uucp $BINDIR{,/magic} $CFGDIR $LOGDIR /var/spool/ifmail/{,BAK,nl.d}  touch           $LOGDIR/{ifdebug,iflog,sysiflog,TheLog}  chown fnet.uucp $LOGDIR/{ifdebug,iflog,sysiflog,TheLog}############################################################################## COMPILAZIONE####################################  SRC="$SRC/`tar zxvf $TGZ -C $SRC | head -1`"# ora in $SRC c'e' il path completo dei source Ifmail  copi.ifmCfg $SRC $BINDIR $CFGDIR $LOGDIR $VERSION  patch -N -d $SRC <ifpatch 2>/dev/null  make clean -C $SRC  make -C $SRC############################################################################## INSTALLAZIONE####################################  make install -C $SRC}# Args: bin_dir, cfg_dir, log_dir, passwords#   note: passwords are colon-separated (":")configure_ifmail() {  dialog --backtitle "$TITLE" --infobox "Configuro Ifmail..." 0 0  BINDIR=$1  CFGDIR=$2  LOGDIR=$3  PASSWDS=$4  SPD="`             cut $EMSIFILE -f1`"  SYSNAME="`         cut $EMSIFILE -f2`"  LOCATION="`        cut $EMSIFILE -f3`"  COMPLETE_PHONE="`  cut $EMSIFILE -f4`"  INTERCOUNTRYPREF="`cut $EMSIFILE -f5`"  LONG_DIST_PREFIX="`cut $EMSIFILE -f6`"  NODEFLAGS="`       cut $EMSIFILE -f7`"  DIALSTRING="`      cut $EMSIFILE -f8`"  SYSOP="`           cut $EMSIFILE -f9`"  COUNTRYPREF="`echo $COMPLETE_PHONE | cut -f1 -d'-'`"  PREF="`       echo $COMPLETE_PHONE | cut -f2 -d'-'`"  PHONE="`      echo $COMPLETE_PHONE | cut -f3 -d'-'`"  FNETCFG=$CFGDIR/config  AREAS=$CFGDIR/Areas  POINTS="`cat $PNTSETUP`"  POST="`cat $COPIUSER`"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -