g_fprintf(f,"#!/bin/sh\n") ;
g_fprintf(f,"#------------------------------------------------------------------------------\n") ;
g_fprintf(f,"#                          NNFS2 configuration file\n") ;
g_fprintf(f,"#------------------------------------------------------------------------------\n") ;
g_fprintf(f,"# The first part set host independent values, the second, host dependent ones\n") ;
g_fprintf(f,"# The default values are for use with an 1.44 Mb floppy and 'mtools' (GNU)\n") ;
g_fprintf(f,"#------------------------------------------------------------------------------\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Name of the file on the medium (if the medium is not a cartridge)\n") ;
g_fprintf(f,"# This name is postfixed by AAA, AAB, AAC, ... for numbering\n") ;
g_fprintf(f,"# If you have the same username on all the hosts, it is OK.\n") ;
g_fprintf(f,"# If it is not the case, replace the line by :\n") ;
g_fprintf(f,"# MEDIUM_NAME=afilename\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"MEDIUM_NAME=\"\\`id -nu || logname\\`\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# The filter to (un)compress, 'gzip' and 'zcat' are GNU freeware.\n") ;
g_fprintf(f,"# If they are not installed, you could use 'compress' and 'uncompress'\n") ;
g_fprintf(f,"# If your medium is huge, you can use open -1 of gzip.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"COMPRESS_FILTER=\"gzip\"\n") ;
g_fprintf(f,"UNCOMPRESS_FILTER=\"gzip -d\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Medium size in byte. The size of floppy. Maximum value is 2Gb\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"MEDIUM_SIZE=\"1400000\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# To correct errors when writing on the medium\n") ;
g_fprintf(f,"# NNFS need a temporary file.\n") ;
g_fprintf(f,"# Possible values are \"memory\" or \"none\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"TMP_FILE=\"memory\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# How to historize modified/deleted files.\n") ;
g_fprintf(f,"# Do 'man strftime' for more information.\n") ;
g_fprintf(f,"# The name is relative to $HOME/.nnfs/\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"HISTORY_DIR=\"history/%%Y_%%m/%%d_%%H:%%M.%%S\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Files that must not be copied on the medium.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# The lines start by + or - to add or remove files verifying the conditions.\n") ;
g_fprintf(f,"# The conditions are :\n") ;
g_fprintf(f,"# 'regex' : A regular expression\n") ;
g_fprintf(f,"# 'size'  : The size of the file in bytes\n") ;
g_fprintf(f,"# 'perm'  : Access mode of the file (see 'find' command)\n") ;
g_fprintf(f,"# 'type'  : 'f' file, 'd' directory, 'l' symbolic link, 'p' pipe (FIFO)\n") ;
g_fprintf(f,"# There is an \"AND\" between conditions on the same line.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If your \"history\" dir is not a symbolic link.\n") ;
g_fprintf(f,"# The minimum filter must filter the \"history\":\n") ;
g_fprintf(f,"#    OUTPUT_FILTER=\"-regex=^\\./\\.nnfs/history/\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Test on the end of the file name\n") ;
g_fprintf(f,"OUTPUT_FILTER=\"- size=+2m type=f\n") ;
g_fprintf(f,"- perm=+0111 size=+50k type=f\n") ;
g_fprintf(f,"+ type=f regex=/configure$\n") ;
g_fprintf(f,"- regex=(/|^)Trash/\n") ;
g_fprintf(f,"- regex=(\\\\.(o|a|so|sl|aux|log|dvi|summary|old)|[~]|/(core|a\\\\.out|XUL.mfasl))$\n") ;
g_fprintf(f,"- regex=^\\\\./\\\\.(nnfs/history|gimp/tmp|netscape|xsession-errors|[^/]*(history|authority))\n") ;
g_fprintf(f,"\"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If you dont want all the file change and file delete to be historized\n") ;
g_fprintf(f,"# set HISTORIZE to \"no\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"HISTORIZE=\"yes\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If you want that new medium is not asked, set the variable to \"no\"\n") ;
g_fprintf(f,"# It is only useful if you have a medium autochanger or you use \"remsh\"\n") ;
g_fprintf(f,"# to copy the files throught a network.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"ASK_MEDIUM=\"yes\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Indicate in which cases a question is asked to the user before updating.\n") ;
g_fprintf(f,"# Possible values are :\n") ;
g_fprintf(f,"#   \"never\"  : Never asks question\n") ;
g_fprintf(f,"#   \"always\" : Always asks question (even when there is nothing to do)\n") ;
g_fprintf(f,"#   \"yes\"    : Asks question if there is file to delete or conflicts\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"CONFIRMATION=\"always\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# NNFS X11 Interface starts update without user intervention\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"AUTO_START=\"no\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# The hard linked file are copied on the other hosts if you set\n") ;
g_fprintf(f,"# the variable to \"yes\". But they are copied as several\n") ;
g_fprintf(f,"# not hard linked files. So if you modify one of the\n") ;
g_fprintf(f,"# not hard linked files you will break the hard link\n") ;
g_fprintf(f,"# on the firts host. So use carefully.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"COPY_HARD_LINK=\"no\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If set to \"no\", only the files on the same file system are synchronized.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"CROSS_MOUNT_POINT=\"no\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If set to \"no\", a file whose mode is the only change will not be copied.\n") ;
g_fprintf(f,"# In any cases, if the file is copied it is with its mode.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"MODE_CHANGE_SENSITIVE=\"yes\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# If set to \"yes\", directory with mode r-w will be\n") ;
g_fprintf(f,"# made temporary writable in order to update their content.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"SYNC_READONLY_DIR=\"no\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"#--------------------------------------------------------------------------\n") ;
g_fprintf(f,"# Medium access : Host dependent\n") ;
g_fprintf(f,"#--------------------------------------------------------------------------\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"case ${NNFS2_HOSTNAME:-`hostname`}.`uname` in\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\"mountable medium\")\n") ;
g_fprintf(f,"CASE=\"mountable medium\"\n") ;
g_fprintf(f,"COMMENT=\"Edit this configuration if you want to use a mountable medium\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Do not forget to set MEDIUM_SIZE to the correct size\n") ;
g_fprintf(f,"because such medium is usually larger than a floppy...\n") ;
g_fprintf(f,"And if medium size is greater than your RAM, set TMP_FILE to 'none'\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"mount /usbmem ; cat </usbmem/%% ; df /usbmem >&2 ; umount /usbmem\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"mount /usbmem ; [ %% = $MEDIUM_NAME.AAA ] && rm /usbmem/$MEDIUM_NAME.??? ; cat >/usbmem/%% ; df /usbmem >&2 ; umount /usbmem\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,"TMP_FILE=\"none\"\n") ;
g_fprintf(f,"MEDIUM_SIZE=\"120000000\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\"cartridge/tape/zip\")\n") ;
g_fprintf(f,"CASE=\"cartridge/tape/zip\"\n") ;
g_fprintf(f,"COMMENT=\"Edit this configuration if you want to use a linear medium\n") ;
g_fprintf(f,"as cartridge, tape, zip, ...\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Do not forget to set MEDIUM_SIZE to the correct size\n") ;
g_fprintf(f,"because such medium is larger than a floppy...\n") ;
g_fprintf(f,"The maximum allowed MEDIUM_SIZE is 2Gb, is the medium is bigger it will not work\n") ;
g_fprintf(f,"And if medium size is greater than your RAM, set TMP_FILE to 'none'\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"dd </dev/cta\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"dd >/dev/cta\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\"cartridge_with_numbered_device_auto_changer\")\n") ;
g_fprintf(f,"CASE=\"cartridge_with_numbered_device_auto_changer\"\n") ;
g_fprintf(f,"COMMENT=\"Edit this configuration if you want to use a linear medium\n") ;
g_fprintf(f,"as cartridge, tape, zip, ... with a device that\n") ;
g_fprintf(f,"can change automaticaly the medium.\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Do not forget to set MEDIUM_SIZE.\n") ;
g_fprintf(f,"because such medium are larger than a floppy...\n") ;
g_fprintf(f,"The maximum allowed MEDIUM_SIZE is 2Gb, is the medium is bigger only 2Gb are used\n") ;
g_fprintf(f,"And if medium size is greater than your RAM, set TMP_FILE to 'none'\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"The example assert that your media devices are named:\n") ;
g_fprintf(f,"   /dev/st1a, /dev/st2a, /dev/st3a\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"dd </dev/st\\`echo '%%' | sed 's/.*\\.AA//' | tr '[A-H]' '[0-7]'\\`a\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"dd >/dev/st\\`echo '%%' | sed 's/.*\\.AA//' | tr '[A-H]' '[0-7]'\\`a\"\n") ;
g_fprintf(f,"ASK_MEDIUM=\"false\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\"cartridge_with_command_to_change_medium\")\n") ;
g_fprintf(f,"CASE=\"cartridge_with_command_to_change_medium\"\n") ;
g_fprintf(f,"COMMENT=\"Edit this configuration if you want to use a linear medium\n") ;
g_fprintf(f,"as cartridge, tape, zip, ... with a device that\n") ;
g_fprintf(f,"can change automaticaly the medium.\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Do not forget to set MEDIUM_SIZE.\n") ;
g_fprintf(f,"because such medium are larger than a floppy...\n") ;
g_fprintf(f,"The maximum allowed MEDIUM_SIZE is 2Gb, is the medium is bigger only 2Gb are used\n") ;
g_fprintf(f,"And if medium size is greater than your RAM, set TMP_FILE to 'none'\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"The example assert that your have a command named\n") ;
g_fprintf(f,"'load_medium' that load the correct medium.\n") ;
g_fprintf(f,"The device name does not change and it is /dev/st1a\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"load_medium %% ; dd </dev/st1a\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"load_medium %% ; dd >/dev/st1a\"\n") ;
g_fprintf(f,"ASK_MEDIUM=\"false\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\"medium_used_via_a_remote_shell\")\n") ;
g_fprintf(f,"CASE=\"medium_used_via_a_remote_shell\"\n") ;
g_fprintf(f,"COMMENT=\"Set this case if you want to use NNFS2\n") ;
g_fprintf(f,"between networked hosts.\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Hosts use 'rsh' to NNFS medium access.\n") ;
g_fprintf(f,"FTP is not used because it asks passwd.\n") ;
g_fprintf(f,"Do not forget to:\n") ;
g_fprintf(f," - Create or update ~/.rhosts file\n") ;
g_fprintf(f," - Use '-l' option of 'rsh' if local and remote UID are different\n") ;
g_fprintf(f,"\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"rsh bat710.univ-lyon1.fr 'cat %%'\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"rsh bat710.univ-lyon1.fr 'cat >%%'\"\n") ;
g_fprintf(f,"MEDIUM_SIZE=\"2147483647\"\n") ;
g_fprintf(f,"TMP_FILE=\"none\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"*.HP-UX)\n") ;
g_fprintf(f,"CASE=\"*.*.HP-UX\"\n") ;
g_fprintf(f,"COMMENT=\"HPUX COMPUTER with floppy\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Use 'mtools' package if possible\n") ;
g_fprintf(f,"it is much quicker than 'doscp', ...\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"The commands use the TMP file.\n") ;
g_fprintf(f,"Remark the use of '&&' to correctly report\n") ;
g_fprintf(f,"the exit status of the copy.\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"TMP=$HOME/.nnfs/$$~ ;doscp /dev/fd0:%% $TMP ; cat $TMP && rm $TMP\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"TMP=$HOME/.nnfs/$$~;cat >$TMP ; doscp $TMP /dev/fd0:%% && rm $TMP\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"*.AIX)\n") ;
g_fprintf(f,"CASE=\"*.AIX\"\n") ;
g_fprintf(f,"COMMENT=\"IBM/AIX COMPUTER with floppy\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"Use 'mtools' package if possible\n") ;
g_fprintf(f,"it is much quicker than 'dosread', ...\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"The commands use the TMP file.\n") ;
g_fprintf(f,"Remark the use of '&&' to correctly report\n") ;
g_fprintf(f,"the exit status of the copy.\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"TMP=$HOME/.nnfs/$$~ ; dosread %% $TMP ; cat $TMP && rm $TMP\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"TMP=$HOME/.nnfs/$$~ ; cat >$TMP ; doswrite $TMP %% && rm $TMP\"\n") ;
g_fprintf(f,"EJECT=\"true\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"*.IRIX)\n") ;
g_fprintf(f,"CASE=\"*.IRIX\"\n") ;
g_fprintf(f,"COMMENT=\"SILICON COMPUTER with floppy\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"On Silicons, it is possible to eject floppy.\"\n") ;
g_fprintf(f,"READ_MEDIUM=\"cat /floppy/%%\"\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"cat >/floppy/%%\"\n") ;
g_fprintf(f,"EJECT=\"eject\"\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"\n") ;
g_fprintf(f,"*)\n") ;
g_fprintf(f,"CASE=\"*\"\n") ;
g_fprintf(f,"COMMENT=\"Default case, should works with 'mtools' and floppy\"  \n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# The command that copy the standard input on medium\n") ;
g_fprintf(f,"# %% is replaced by 'MEDIUM_NAME.MEDIUM_NUMBER', for exemple : exco.AAB\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"WRITE_MEDIUM=\"mdel a:%% 2>/dev/null >&2 ; mcopy - a:%%\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Copy the file from medium to standard output.\n") ;
g_fprintf(f,"# The command must exit with an error is there is one.\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"READ_MEDIUM=\"mcopy -no a:%% -\"\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"# Eject the medium (If used the %% will be replaced by the medium name to eject)\n") ;
g_fprintf(f,"#\n") ;
g_fprintf(f,"EJECT=\"true\" # We can't eject floppy disc on most computer\n") ;
g_fprintf(f,";;\n") ;
g_fprintf(f,"esac\n") ;
