Changelog for MSS.
As always, make sure you backup the userfiles, passwd file and group file before
upgrading. Run it atleast once in debug mode, preferebly in HIGHDEBUG mode.
If upgrading more then one version at a time, make sure you follow each versions
upgrading instructions, starting from your current version and up.

Package versions have nothing to do with the versions of the individual scripts.

Package 2.3
Slave:
TRANSFERCREDITS
 2.0   :  New: Rewritten pretty much from scratch. It had lagged behind on updates
               and was pretty badly designed. It now uses procedures like the rest
               of the mss family. That means it should be a bit faster on a few
               things.

               As a result of the above, checking status is much faster now.

               And as a result of the above (hehe), we now show before and after
               credits directly when someone moves creds. A new option added to
               disable that feature if you want, since it does take a little
               longer to make this check. 
               With that feature enabled, it will log before and after
               creds from both sites which should help if someone get their
               credits nulled for some reason.
               Which leads us to...

               Config part of transfercreds.sh moved to mss-slave.conf for easy 
               upgrades in the future. Also uses mss-slave.id for GLROOT.
               Check how to upgrade at the end of this versions changelog.

               I had disabled shell usage of this script a while back as it didnt work
               100%. It does now. I realize this isnt really needed since mss-core.sh
               handles that much better ( single or all users etc ), but I have a feeling
               someone might be using transfercredits.sh as a stand-alone script so thats 
               included it anyway. Simply run it from shell and it should display a
               slighly different helptext.

               Lockfile management got a lot better. Instead of just quitting after 
               finding a lockfile (user.lock), it will now retry once a second for up 
               to 10 seconds before giving up. If giving up, it will clear any lockfiles
               much like glftpd does it its locked for too long. This is exactly like
               mss-core.sh handles userfile locking.

               Added more checks at the start for required binaries. Mostly just a help for
               new users. A 'bc' test calculation added for verfication too.

               CreditAmount verification is faster. Before, it checked 5 or 6 things to make sure
               the user wasnt trying to screw up the script. Now, it simply tries to
               remove all number chars from the amount of credits. If its not empty, the
               user made a mistake. Much easier to check this way and probably a little
               safer too. Hardcoded to 6 chars tops as well. Any more and it will insult the
               user and abort.

               I also do the above check on digits when reading current credits from both
               sites so theres nothing wrong with the current credits value.

               Checking status is now logged with current values.

  Update from 2.2.2
               Slave: Move some of the settings from your current transfercredits.sh into
                      the bottom of mss-slave.conf. ONLY these are needed:
                      COMMAND=
                      TRANSFERLOG= (Previously called LOG only. Renamed).
                      TRANSFERTMP= (Previously called TMP only. Renamed).
                      BIN=
                      MINAMOUNT=
                      MAXAMOUNT=
                      AUTOMATICSTATUS=TRUE <- NEW. See README for info.

                      Once that is done, replace transfercredits.sh and try it from
                      shell.

                      Check the default mss-slave.conf for example.
                      Make sure that you do NOT move SOURCENAME and those settings from
                      your old transfercredits.sh. They are in mss-slave.conf already.

                      If you have transfercredits.sh in the same dir as mss-slave.conf and
                      mss-slave.id, you do not have to edit transfercredits.sh. If they
                      are not there, change paths in the script itself.
               

##########################################################################################
# Previous version below (mss 2.2.2)
##########################################################################################

Package 2.2.2
Slave:
MSS-CORE
 2.2.1 :  Fix: The movecreds command didnt work. Or well, it worked but since
               I hadnt removed the # from the mv line, it never actually copied
               the new userfiles after checking that they were ok.
               Thanks LPC for finding this one.

          Fix: When moving creds it made a check that the added value is not less
               then what it started with ( just a safety precausion ). If 
               a user had a lot of credits, it would spit out an error like:
               "integer expression expected". That was harmless but annoying.
               Fixed now in either case.

  Update from 2.2.1
               Slave: Replace mss-core.sh

##########################################################################################
# Previous version below (mss 2.2.1)
##########################################################################################

Package 2.2.1
Hub:
MSS-CUSTOMHUB
 0.1   :  New: This script is new and for the hub. Its a mss-custom.sh script but
               ment for hubs use for custom commands that you want to sync something
               on.

  Update from 2.2.0
               Install mss-customhub.sh if you want.

##########################################################################################
# Previous version below (mss 2.2.0)
##########################################################################################

Package 2.2.0
Slave:
MSS-CORE
 2.2.0 :  Add: Added option PINGOPTIONS. Its the options it uses when pinging if
               PINGTEST is set to TRUE. Previosly, it was hardcoded to -w2 but 
               according to [Acido], that is not the case in, for instance, Debian.
               What we want it to do is send 2 pings only. Use -c2 in Debian.
               Check 'man ping' for how to limit the number of pings sent.

MSS-CUSTOM
 0.1   :  New: This script is new for the slaves. Edit it to check what it can do.

  Update from 2.1.9:
               Replace mss-core.sh
               Add in mss-slave.conf, below PINGTEST:
               PINGOPTIONS="-w2"

               Edit mss-custom.sh to see if its anything you can use.

##########################################################################################
# Previous version below (mss 2.1.9)
##########################################################################################

Package 2.1.9
Slave:
MSS-CORE
 2.1.9 :  Fix: Fixed "-eq: unary operator expected" errors. It was nothing dangerous
               just forgot to set a 0 on a variable when adding 'backup' in 2.1.8.

          Fix: When NFS check failed, it didnt give the right variables to test the
               connection manually. No biggie, just information error.

  Update from 2.1.8:
               Hub: Replace mss-site.sh

##########################################################################################
# Previous version below (mss 2.1.8)
##########################################################################################

Package 2.1.8
Hub:
MSS-SITE
 0.8   :  Add: Added command 'dellogs' (site mss dellogs) to remove all fetched logs
               in the FETCHLOGSDIR. This will still leave the reports, just del the logs.
               Thanks LPC for the idea.

          Add: Added command 'backup' (site mss backup) which tells all slaves to run
               'mss-core.sh backup' using the actionfile system.

Slave:
MSS-CORE
 2.1.8 :  Add: Added support for backup option in mss-site.sh (above).

  Update from 2.1.7:
               Hub: Replace mss-site.sh
               Slave: Replace mss-core.sh


##########################################################################################
# Previous version below (mss 2.1.7)
##########################################################################################

Package 2.1.7
Slave:
MSS-CORE
 2.1.7 :  Fix: The first fix described in version 2.1.4 broke another function.
               Basically, when I switched dirs for it to start in, it gained back
               the ability to del users which is not on the hub anymore but it lost
               the ability to add new ones when running in full and fullsync (actionfile
               worked). Mostly new users noticed this when trying to sync the first time.

               I did a fix for this, but the whole 'switch dir' to where it should be
               needs a total rewrite cause its a mess. I need to add full paths to each
               argument instead, but thats a bigger project. I do not have time right now.

  Update from 2.1.6:
               Slave: Replace mss-core.sh. 

##########################################################################################
# Previous version below (mss 2.1.6)
##########################################################################################

Package 2.1.6
Slave:
MSS-CORE
 2.1.6 :  Fix: When moving stats in 'fullstats' and 'full', it no longer reads the 
               hubs stats from the local copy but directly from the hub users itself.
               First because it could take a few minutes between copying userfiles and
               it syncing a users stats, so any stats the user got on the hub in that time
               would be lost.
               Second, if you have multple slaves and you crontabbed either 'fullstats' or
               'full' on the same time, it could copy the files at the same time, leading
               to missing stats, because only the last slave to sync a user would count
               (providing the user didnt have 0 stats on the slave).

               Above only applies to those that use RUNLOCAL=TRUE, otherwise it always
               does everything from the hub directly.

               Yes, this means its a bit slower when syncing stats depending on the line, but
               its well worth it.

          Fix: RPCINFO was not in default mss-slave.conf. Forgot to add it I guess. Thanks LPC.

          Fix: USENFS no longer checks for 'status' on the hub NFS process list. Instead, it checks
               for rquotad. Not everyone showed status but NFS was working anyway. Thanks LPC.

          Fix: Changed a few awk's to cut instead. Should help on some distros although no
               report on awk failing. This applies to full, fullsync and fullstats.
               Also changed how it detects userfiles from grep -w FLAGS --> grep "^FLAGS ".

          Fix: Commented out the sleep 0.$RANDOM when checking lockfile. Search for $RANDOM and
               remove the # if you want to use it.

          Fix: The integrity command did not say which site it was checking in the logs. Might
               be nice if it did, yeah ?

  Update from 2.1.5:
               Slave: Replace mss-core.sh.
                      Check if you have RPCINFO in your mss-slave.conf. If not, add
                       RPCINFO=/usr/sbin/rpcinfo
                       below USENFS.


##########################################################################################
# Previous version below (mss 2.1.5)
##########################################################################################

Package 2.1.5
Slave:
MSS-CORE
 2.1.5 :  Fix: There was a short period of time between the checking of the lockfile
               and the creation of it, leading to the possiblilty to multiple mss-core
               running at once.

               The checking of lockfile and creation of it were moved next to each other and
               It will now sleep for 0.$RANDOM before checking lockfile (between 0-1 seconds).
               I have no idea if $RANDOM works on all distros. Just search for $RANDOM and
               comment out that line if you get fast sleep errors.
               Thanks to thulle for seeing this one.

          Add: Added PINGTEST to config. This will do 2 pings on the hub before it starts.
               Problem was, mss-core checked if it could read the VERIFYUSERS on the hub.
               If the nfs/samba was down, it could hang the session totally (depending
               on mount options ofcourse. soft/hard etc)
               Anyway, now if it fails both pings, it will forcefully unmount both
               and USERSOURCE and PASSWDSOURCE. Note that REMOUNT is recomended when
               having this one true.

          Add: Added USENFS to config. Like above, but this one will check that the
               NFS service is answering on the hub before continuing. You can use both
               PINGTEST and USENFS. If you do use NFS to mount stuff, USENFS is strongly
               recomended.
               Also added RPCINFO that is used to check upstatus of NFS.

               I'd like to add a USESMB check as well, but not sure how to remotely check
               if the services are up.

          Add: Added DNSHUB to config. This is the name or IP of your hub. If you mount
               USERSOURCE and/or PASSWDSOURCE in /etc/fstab, you can leave this empty and
               mss-core.sh will check the name itself. If its not in there, set it.
               Just leave it empty and run once in debug mode. See if it complains.
               It's used for PINGTEST and USENFS.

          Add: The function 'movecreds' introduced in 2.1.4 got an update. It can now move
               creds for a single user, a number of users or all users. 
               Run 'mss-core.sh movecreds' for explanation.


  Update from 2.1.4:
               Slave: Replace mss-core.sh.
               Slave: Add to mss-slave.conf, above REMOUNT,
                      PINGTEST=FALSE
                      USENFS=FALSE
                      RPCINFO=/usr/sbin/rpcinfo
                      DNSHUB=
           
                      Check out the README for more detailed instructions on the new
                      settings before setting any of them to TRUE.


##########################################################################################
# Previous version below (mss 2.1.4)
##########################################################################################

Package: 2.1.4
Slave:
MSS-CORE
 2.1.4 :  Fix: When doing full and fullsync, it entered the wrong starting directory.
               This made it so that some users were never deleted, since that module
               checked the hubs users directory vs the hubs users directory =)
               Now fixed so upgrade and do a full sync and perhaps it will delete someone.

          Add: By request from Lowet, added a way to move everyones credits from the 
               slave back to the hub. Nice if you are removing a slave or similar.
               Dont test this unless you have to. It will piss users off I bet, hehe.
               ( mss-core.sh movecreds ).
               It will make a local backup first if backups are enabled in the config.

  Update from 2.1.3:
               Slave: Replace mss-core.sh only.


##########################################################################################
# Previous version below (mss 2.1.3)
##########################################################################################


Package: 2.1.3
Slave:
MSS-CORE
 2.1.3 :  Del: Previosly, there was a size check on the userfile. This was before
               I added the integritycheck on userfiles to make sure it really IS 
               a userfile. Thats not needed anymore and it only cause problems for
               people with different cluster sizes, so I removed the size check.

          Add: If a binary is missing when running, it will now log that to the 
               highdebug log as well as output to screen. Should help those poor
               folks to get it to work from shell but not from crontab, ala ragusallad =)

  Update from 2.1.2:
               Slave: Replace mss-core.sh only.

##########################################################################################
# Previous version below (mss 2.1.2)
##########################################################################################

Package: 2.1.2
Slave:
MSS-CORE
 2.1.2 :  Chg: The message "Lockfile exists and mss-core.sh running" was moved to the
               highdebug log instead of normal log. Also shows in debug mode in shell.

TRANSFERCREDS
 1.2.1 :  Add: Added a test calculation to make sure bc is working. It is mostly ment
               for new users so the userfiles does not get corrupted because bc was not
               set up beforehand. No other changes.

Hub:
MSS-HUB.ID
 NoVer :  New script. Holds GLROOT and SOURCENAME info for the hub.

MSS-POST
 0.4   :  Add: Changed to use mss-hub.id instead of having settings in the script itself.
          Add: Will look for mss-hub.conf in the same dir as itself if not specified.

MSS-SITE
 0.7   :  Add: Changed to use mss-hub.id instead of having settings in the script itself.
          Add: Will look for mss-hub.conf in the same dir as itself if not specified.


  Upgrade from 2.1.1:
               Slave:
               copy mss-core.sh and transfercredits.sh to your replication dir on the 
               hub, set executable perms on them and replicate it out with mss-site.sh 
               from inside glftpd on the hub.

               Hub:
               Copy mss-hub.id to the same place as mss-post.sh and mss-site.sh (/glftpd/bin).
               Edit mss-hub.id to suit your settings.
               Edit mss-hub.conf and remove SOURCENAME if you have that in there.

##########################################################################################
# Previous version below (mss 2.1.1)
##########################################################################################

Package: 2.1.1
MSS-CORE
 2.1.1 :  Fix: Lowet found an interesting feature. Some userfiles seems to get fudged up
               stats when nuking. The NUKE amount seems to roll over sometimes. As far as
               I can tell, it is glftpd who does this. To check if you have such users
               issue the following command from shell:
               grep "^NUKE " /glftpd/ftp-data/users/*
               Have a look at the last number in that list. That is nuked MB on that user.
               If that number looks too high, like 4294967291, that user got fudged 
               somehow, and probably not by me.
             
               In either case, I now do a check before moving nuke stats and withdrawing
               the nuke sum from the hub. If the nuked MB is more then 8 chars, I will NOT
               touch the NUKE value or withdraw any sum from hub. It will warn to the log
               though.
               To fix these users, set the NUKE value in the userfile to:
               NUKE 0 0 0.

  Upgrade from 2.1:
               copy mss-core.sh to your replication folder on the hub, set executable 
               perms on it and replicate it out with mss-site.sh from inside glftpd.


##########################################################################################
# Previous version below (mss 2.1)
##########################################################################################

Package: 2.1
GENERIC Update: A new function went into place with version 2.1. Replication.
                What this means is that you have one folder on the hub that contains
                the scripts for the slaves and incase of an update, you put the new files
                in there, execute a command from the hub and it is simply pushed out to the slaves.
                For this to work, DESTNAME had to be moved out of mss-slave.conf since
                that is different for each slave. So a new file was created; mss-slave.id.

                Also added GLROOT to mss-slave.id and set mss-slave.conf to use $GLROOT instead
                of /glftpd because that can also be different. mss-slave.id is the only file
                that should not be replicated, all others can.

                When replication is complete, mss-core.sh will send a report to the same logfile
                as integcheck uses. If it can find the version (VER=) in the replicated script, it
                will report that too. That way, after you sent out new scripts, you can check the
                reports on the hub (site mss readreports) to see that the slaves got them.

Slave scripts: 
 MSS-SLAVE.ID
 NoVer :  New: This file contains GLROOT and DESTNAME. It must reside in the same folder
               as mss-core.sh. It should never be replicated from the hub.

 MSS-CORE.SH
 2.1   :  Add: Added functions to handle the replication system. Given the actioncommand
               'UPDATE <filename> destinationdir', it will copy that file to the slave 
               (note that UPDATE <filename> is the internal name for it. Nothing you use).
               If the file you are trying to push out from the hub already exists in the slaves
               dir, it will make a folder called mss-oldfiles in the same folder as mss-core.sh in in, 
               move the file there and then grab the new one. It will also report back to the hub 
               when it got it (as well as normal logging) so you can check from the hub that 
               all slaves got it.
          Add: Will now read mss-slave.id for DESTNAME if it is not defined in mss-slave.conf.
          Fix: Moved down creation of the lockfile beneith all the checks so it does not leave
               the lockfile incase a check goes wrong.
          Fix: When adding and deleting groups, it would not see a difference between, for instance,
               the TRiAL and the TRiAL-2 groups, leading to some interesting results. With fullsync
               that did not matter but with the actionfile system it is important that it gets it 
               right on the first go. Fixed it by using grep -x "GROUPS $group" instead of just grep.
          Fix: When doing a fullsync from the slave, it entered the slaves userfolder instead of
               the hubs. This caused it to not add any new users. Worked with actionfile system though.
          Fix: Bad bug.
               When running a fullsync using RUNLOCAL (copying hub userfiles to slave)
               and it found an actionfile in the middle of the sync, it would sync that user from the
               copied version of the userfile. That file did not have the new info since the userfile
               was copied before the change was made on the hub. It now switches back to the local 
               userfiles on the hub, should I find an actionfile in the middle of a fullsync.
               
               If you are running in RUNLOCAL=TRUE mode, it will also make a new local copy of those users
               found in the actionfile so that the info does not get overwritten when it does the normal
               sync further down.
               (ie, userfiles are copied in fullsync. User nisse has not yet been synced but you add something
               to his userfile on the hub, causing mss-core.sh to pause the fullsync to do the actionfile. 
               Once he is synced from the actionfile, the fullsync will sync him again, but this time read
               from the local copy, so the changes the actionfile made are poofed.)
            
               Another fullsync would fix this problem, but you should not need to do fullsyncs if the
               actionfile system worked 100% (which I hope it does now).
               
 MSS-RLSCOMP.SH
 0.3   :  Add: If MSSSLAVECONF is not defined, it will look for it in the same folder as
               mss-rlscomp.sh is executed.
          Add: GLROOT will now be read from the mss-slave.id file if it is not defined
               in mss-rlscomp.sh.

 MSS-SLAVE.CONF
 NoVer :  Add: MSSREPL=$PASSWDSOURCE/mssrepl
               (Added below FETCHLOGSDIR.)
               This is the replication folder on the hub, as seen from the slave.
               Must point to the same folder as MSSREPL= in mss-hub.conf
          Del: Deleted DESTNAME as this is now located in the mss-slave.id instead.
       Change: Changed all instances of /glftpd to $GLROOT. This is also in mss-slave.id now
          Del: Removed the GLETC setting for mss-rlscomp.sh as it now uses PASSWDDEST instead
               (no difference really. GLETC just got redundant when we changed /glftpd to $GLROOT).

Hub scripts:
 MSS-SITE.SH
 0.6   :  Add: 3 new functions. delreports, repllist and replicate.
               Previously, the integcheck command would clear the reportfile each time it ran, since it
               was the only thing that used the report stuff.
               Now the replicate system uses it too, so integcheck should NOT clear it out.
               The delreports command will tell the slaves to clear it out instead.

               repllist will list all script in the hubs 'pushout' folder (MSSREPL in config).

               replicate will write to the actionfile, telling the slave(s) to get the 
               files from the hubs 'pushout' folder, and where to put them.
               (readreports will read the report send back from the slave when updating someting.)

 MSS-HUB.CONF
 NoVer :  Add: MSSREPL="$GLETC/mssrepl"
               This is the local folder for replication files. As per default, its located
               in the /etc folder inside /glftpd.
               mss-site.sh will create this folder if it is not there.

** Update from 2.0.1:
         Hub: Replace mss-site.sh
              Add to mss-hub.conf, below MSSLOGS (see example .conf): 
               # Path to your mssrepl as defined on the slaves. For msssite.sh only.
               MSSREPL="$GLETC/mssrepl"
        
       Slave: Replace mss-core.sh
              Replace mss-rlscomp.sh
              Copy mss-slave.id to the same folder as mss-core.sh and edit the 2 settings in it.
              Edit your current mss-slave.conf and..: 
               Remove GLETC setting.
               Change all /glftpd to $GLROOT ( /glftpd/etc becomes $GLROOT/etc ) See example
               ( Take care not to change VERIFYUSER. That should still be 'glftpd' since its a user. )
               Remove DESTNAME setting.
               Add below FETCHLOGSDIR:
                MSSREPL=$PASSWDSOURCE/mssrepl


##########################################################################################
# Previous version below (mss 2.0.1)
##########################################################################################

MSS-RLSCOMP
0.2   :  Fix: mss-rlscomp.sh used EXCLUDE in mss-slave.conf to exclude dirs, but EXCLUDE 
              were also used for mss-core.sh to exclude users. Not good.
              Renamed the bottom EXCLUDE in mss-slave.conf to EXCLUDEDIR instead.
              Also added some crap code so if EXCLUDEDIR is empty, the script will still
              run.

  Upgrade from 0.1 : Replace mss-rlscomp.sh on the slave.
                     In mss-slave.conf, change the bottom EXCLUDE to EXCLUDEDIR (not the
                     top one).

##########################################################################################
# Older version below (mss 2.0)
##########################################################################################

TRANSFER:
1.2   :  Fix: Changed how it do calculations. expr that I used before could crap out
              on big numbers. I now use 'bc -l' instead.
              This means that you must have the binary 'bc' in /glftpd/bin.
              bc requires some libs, like libreadline.so.4.2 and libncurses.so.5
              so run a 'locate libreadline.so.4.2' and copy that file to 
              /glftpd/lib as well. Same for libncurses.so.5
              If you get errors about such a file when running it, do the same
              thing for that one.

         Add: Added more logging to transferlog incase stuff goes wrong etc.
              It will log failures etc and give you the exact command the user made.
              This means a larger transfer log, but I feel its worth it.

         Add: Transfer now usees the same method to lock userfiles as glftpd and will
              wait 1 second if it finds one one either site. After that, it will abort.
              As always, should it be locked or get an error, NO userfiles will be touched.

         Add: We now do a general integrity check on the userfiles before transfering anything.
              It also does a check on the temp files with modified credits, before moving them
              as well as making sure the temp files can be moved.

         Add: Changed all grep from '-w CREDITS' to "^CREDITS " to make it more secure.

MSS-CORE (previously mss.sh):
2.0    : Chg: Scripts renamed. Since we have scripts on both slaves and the hub now, it
              got confusing which script goes where. Now called mss-core.sh, mss-slave.conf
              mss-hub.conf etc.

         Add: Rewrote logging to make it smaller and easier to read.

         Add: highdebug got its own logfile so you can keep it on TRUE and still
              not clog up your normal logs. I found that when you needed to enable
              highdebug, it was often too late.

         Add: Some more info when runnning it in HIGHDEBUG="TRUE" and DEBUG mode.

         Add: Actionfile system (near instant replication. 1 min or so). See readme
              for how this works.
 
         Add: mss-site (hub admin tool). Check readme for info on this one.

         Add: mss-rlscomp (near instant moving of stats after race for zipscript-c).
              See readme for how this works.

         Add: A couple of new execution arguments, including 'full' for doing
              fullsync followed by fullstats. Remember that fullsync takes a while
              so if you crontab it to do 'full' 2 minutes before midnight, stats
              might reset before it gets to the fullstats part.
              Better to cron it with 'fullstats' 2-5 minutes before midnight instead.
              Its always best to use a midnight script though. Examples of that can
              be found at Zio's webpage.

              Another one added is 'integrity'. What it does is check that all users
              on the hub exists in the hubs passwd file and vice versa. It also does
              a integrity check on each userfile to make sure they are not missing any
              critical fields.
              It then does the same check on the slave. 'mss.sh integrity debug'
              Note that this can be quite slow sometimes due to checking everything
              directly from the hub instead of from a local copy.

              There are a few others as well. Some are mostly ment for the ActionFile
              system incase you wonder what the heck they are used for.

         Add: We had a flaw in earlier versions (imagine that). If you upload 200
              meg to a slave, the stats are moved to the hub & you are nuked on the
              slave, you would still get to keep your stats from that release since
              glftpd never puts stats in the negatives on the slave.

              We now check when moving stats: Does the user have any nukes on him (NUKE)?
              If so, subtract the number of bytes from the UP stats on the hub.
              Note: glftpd dosnt save the number of files nuked in the NUKE field. Only 
              how many TIMES the user was nuked. So we can only subtract the bytes. Files
              will be miscalculated, but hey, who cares, right ?

              Therefor, we have 5 new options in the conf to handle this:
              WITHDRAWNUKE=    Use this method at all? If FALSE, it will let the user keep 
                               his stats, providing they were moved to the hub before nuke.

              WITHDRAWALLUP=   Subtract nuke values from the ALLUP values on the hub?
              WITHDRAWMONTHUP= Subtract nuke values from the MONTHUP values on the hub?
              WITHDRAWWKUP=    Subtract nuke values from the WKUP values on the hub?
              WITHDRAWDAYUP=   Subtract nuke values from the DAYUP values on the hub?
              Observe that it will never set any values below 0 on the hub. If nuke value
              is higher then the current value on the hub, it will set it to 0 on the hub.
              If the value is already 0 on the hub, it wont touch it.

              All other UP values have already been moved when this runs, so it should get it
              right.

              A problem that can arise is if you nuke a release upped yesterday, for instance.
              If you then have WITHDRAWDAYUP=TRUE, it will subtract the nuke value from 
              todays upload stats, even though it was not upped today. 
              No other way to do it IMO and no biggie if it happens. If you like, you can
              keep WITHDRAWDAYUP on FALSE to only subtract from the others.

              Note: When upload, glftpd adds the stats to all 4 values (ALLUP, MONMTHUP etc)
                    so subtracting from all of them should be done. glftpd does not move
                    stats from, say, WEEKUP to MONTHUP. It only resets WEEKUP value to 0
                    at the time of a new week.

              If any of the settings in the conf is either missing or not set, it will default
              to TRUE.

         Add: When verifying that link is up it will also try and grab the FLAGS
              field from the VERIFYUSER. This should help with those caching file-
              systems that make it look like the link is up although it might not be.

         Add: If the lockfile exists it will now check if it is running.
              If it is not running, it will delete the lockfile and go.
              If not, it will quit as usual.
              This makes LOCKOVERRIDE obselete, so remove that from the config
              and delete any 'touch' you made on the hub at bootup ( see v1.1.4 ).

         Add: If a user exists in the passwd file on the hub, but there are no userfile
              for that user on the hub, something baaad happened there. Previously, mss
              only logged it but now it will search through backups made from the local
              copy, starting with the newest one. If it find the user there, it will 
              restore that file to the hub automatically, then continue syncing.
              If not, it will log it with a warning, just like older versions.
              This is not 100% since the latest working backup might not be the one
              this particular slave restores. However, its better then a non working 
              userfile.

         Add: If you delete and purge a user, a copy will still be saved in the 'deleted'
              folder on each slave. If you should add a user with the same name, it will no
              longer automatically restore that user. It will log the existance for each
              time it runs so you can either delete the copy or restore manually.
              This is so that it does not restore a new user with the same name as someone
              else, which you deleted 6 months ago =)
              
         Add: Since I had atleast one report of corrupt userfiles (never experienced
              this myself), it will now use glftpds way of locking userfiles whenever
              it changes anything in them ( $USER.lock ).
              It will also check for the existance of any such file before changing
              anything on a user (incase glftpd has it locked). If it exists, it will
              try 10 more times with 1 second intervals. If its still there it will skip that
              user (means hes either busy on the server or there is a frelled .lock file).

         Add: Also new because of above: When moving stats it creates a new userfile
              in the TMP folder which, when finish, overwrites the actual userfile on
              the hub. mss now do a generic check on that file to make sure it has all
              the fields it should have, part from IP and GROUP (since those can be
              non existant. Will give warning on no IP or GROUP though). 
              If this should fail, it will log it (normal LOG and when using debug)
              and leave the temp file there. It will paste the original userfile to it
              so you can check how it looked before and how the new file it created
              looks now. This should help debug any errors to userfiles.

              So, before moving stats, if there is something to move, it will check the 
              integrity of the userfile on the hub and the slave. If they are ok
              it will build the new userfiles for them. Once finished, it will check
              the integrity of both those new files and if ok, overwrite the ones on the
              hub and slave. If ANY of the files fail, no files will be overwritten.

              Previously, if it screwed up the writing to the hub, the stats would still
              be zeroed on the slave. Whaaa, whiny users.

         Add: Like above, syncing normal user information changed in the same way. Instead
              of doing the changes directly to the userfile, mss now creates a temporary
              userfile which it does the changes to. Once everything is synced, it checks the
              integrity on the new file and if its ok, overwrites the userfile on the slave.
              Like above, should it go wrong, it will leave the ERROR file in your TMP
              folder with the original userfile pasted to the bottom of it.
              mss will not sync a user if he has an ERROR. file in TMP.

         Add: If it fails to read any of the required fields in a userfile when syncing
              it will skip that user entirely and do nothing to him.
              Previously it would keep syncing the user anyway, even though something
              apparently went wrong.

         Add: When adding a new user, it will make sure it got all the values in the
              newly zeroed userfile.

         Add: Instead of just copying group and passwd right over the one on the slave
              it will now copy it to TMP. It will then run a md5sum on the new copy and
              if it does not match the original one on the hub, it will just deleted
              the version in TMP. If they do match, that means the copy went ok and it
              will be overwritted on the slave.

         Fix: Like for the transfercreds.sh script, it now uses 'bc' instead of 'expr'
              when calculating. expr have a naughty way of wrapping big numbers around.
              Try from shell: expr 1 + 10000000000
              Does that say 10000000001 ? Nope.
              Try: echo "1 + 10000000000" | bc -l
              Does that say 10000000001 = Yepp. bc good, expr bad, Kreaaaagh Bundulo.

         Fix: When deleting a user it verifies that the username is not in the passwd.
              problem was that it did not delete the user if he has a similar name
              as someone else. Ie, deleted the user Jocke, but he wasnt deleted
              becuase you had a user called ocke on site too.
              It now checks the whole name so cant go wrong.

         Fix: If it does not manage to umount a failed share, it will not
              mount it anyway. This should fix the multiple failed mounts that
              some people were experiencing.
    
         Fix: Had a few hardcoded 'sleep 0.1' that was changed to use SLOWTIME
              instead. Remember to set it to 0,1 if you get sleep errors. Not recomended
              that you set it to 0.

         Fix: Changed how it searches the values in the userfiles. It will always
              skip grep in the TAGLINE and USER fields, unless when syncing TAGLINE 
              ofcourse, so if people use, for instance, CREDITS in their tagline
              it wont matter. Same with user comments.
              All the greps have been changed from 'grep -w CREDITS' to
              grep "^CREDITS ". That should secure it even more from getting the
              wrong info.

         Del: Removed the ZIP option. It will always use tar's -z option now (zcf).
              Remove ZIP setting in config. Lame frigging option anyway.

-------------------------------------------------------------------------------
1.2   :  Add: I split the script into proc_ sections so you can utilize
              the different parts in it seperetly. This makes it pissa.. err
              possible to sync or move stats from a single users.
              I also added some other goodies that you will see when you 
              run mss.sh from shell.
              This changes how you should put it in the crontab.

              This opens up the possiblily to have a post or pre command
              on the hub that executes something so the slave triggers the
              sync on that user only. So when you do site addip user blabla, it 
              will send something to the slaves so they run mss.sh singlesync
              (username) and it does not have to wait for the crontab to sync
              the whole bunch of users. There is no support for this yet though.

         Add: I changed the BACKUPS option so it should work on all
              distros, regardless of ls output. Hope this works good.
              It was only the part that deletes the oldest backups that
              was changed.

         Add: Changed how it backs up the HUBs userfiles. Previously
              it backed up the files from last times sync. Changed that
              so it first copies them to the slave and then backs them up.
              This only applies if you have COPYLOCAL on true ofcourse.
   
         Add: Added more debug output when syncing passwd/group file.

 Update from 1.1.4: * Replace mss.sh.
                    * Change your crontab for syncing users and add
                      'fullsync' after it (mss.sh fullsync) without the ''.
                    * Change your crontab for stat moving and change
                      the 'stats' word to 'fullstats' (mss.sh fullstats).
                    * Run mss.sh from shell to see what else you can do.
                    * No changes to mss.conf

MSS:
1.1.4 :  Fix: When syncing LOGINS, it did not say what it synced too
              in the logs. Only a log error and no big deal.
         Add: Added the option OVERRIDELOCK= to config file.
              See the README for full instructions about this one.
              Basically, its a way for the HUB to reset the lockfile
              on the slaves, should it exist.
              
 Update from 1.1.3: * Replace mss.sh.
                    * Add below LOCKFILE in mss.conf:
                      LOCKOVERRIDE=/glftpd/etc.ext/mss.lock.override.tmp
                      Make sure you check the readme for what it does.
                      If you do not add this, it will simply not be used.

MSS:
1.1.3 :  Fix: The LOGINS row in the userfiles were not synced at all
              due to 3 spelling mistakes. Thanks to Lowet for reporting
              that one. No harm done to userfiles though.

 Update from 1.1.2: Replace mss.sh only. No other changes.

MSS
1.1.2 :  Fix: PERMS is now set on a userfile the first time it is 
              added too. Previously, you might get write errors on
              the newly added user until the script ran again and 
              changed perms on all users.
              Setting PERMS= to "" will still disable this feature.
              Thanks to Cleese for reporting this one.

         Add: Added a new option to mss.conf. REMOUNT=
              In case MSS can not find the verifyuser, it will attempt
              to umount users.ext and etc.ext (or whatever you named
              them too) and then try to mount them again.
              Only set this one on TRUE if the 2 paths show up when
              running 'df' AND you have the entries for them in /etc/fstab.
              Setting this to FALSE will act as it did before, IE stop the
              script if the verifyuser can not be found.
              This should help if the HUB is on a dynamic IP and the slaves
              often loose contact to it.

         Fix: chmod errors because of timeout on link will no longer be 
              mailed to the user running the script in the crontab.

         Add: Changes PASSWDSOURCE and PASSWDDEST to point to the folder
              instead of the the file. I figure everyone had
              GROUPSOURCE and GROUPDEST to the same as PASSWDSOURCE and
              PASSWDDEST anyway. Removed GROUPSOURCE and GROUPDEST settings.

         Add: When checking for deleted users and you used COPYLOCAL to copy
              the userfiles locally, it would switch back to checking at the
              HUBs folder instead of the locally copied one if a user could
              not be found in the local copy. It would then keep checking on
              the HUBs folder. It will now only check the user it could not
              find towards the HUBs folder, then continue in the local copy
              for the rest of the users (until it finds another one missing).
              This should make it slighly faster when it comes to checking 
              for deleted users, especially if you are on a slow line.

 TRANSFERCREDS:
 1.1   : Fix: In transfercreds.sh, it gave the wrong example line when
              running it from shell. Updated it to 1.1, but dont bother
              changing it, cause the change is so small and wont affect
              anything.

 Update mss from 1.1.1: Edit your current mss.conf:
                        1: Below ZIP=, add REMOUNT=FALSE (or TRUE).
                        2: Remove the line starting with GROUPSOURCE=
                        3: Remove the line starting with GROUPDEST=
                        4: Change PASSWDSOURCE and PASSWDDEST to reflect
                           the folder instead of the file (if you had
                           /glftpd/etc.ext/passwd, change to /glftpd/etc.ext ).
                        5: Replace the mss.sh file.


1.1.1 :  Fix: When backing up both hub and slave files, it often
              deleted the wrong backup files. It now does a full list
              of the dir (ls -tl) and use the 9th argument as the 
              dirnames. This is on Redhat and Mandrake. If you are
              using another distro, try ls -tl in a folder. The files
              should be sorted by date, with the oldest at the bottom.
              The filename should be word 9. For instance:
              -rw-r--r--    1 root     root         1630 Nov 26 20:59 CHANGELOG
              ^1st word       ^3rd     ^4rth        ^5th     ^7th     ^9th word

              If your distro shows it as another word number, edit mss.sh and 
              find this line:
  for old in `ls -tl $BACKUPDEST | grep -v deleted | tail -n $del | awk '{print $9}'`; do
              and change the the 9 to the actual word number.

  Update from 1.1: Only mss.sh changed. Just replace that one straite up.

1.1   :  Fix: Now deletes the oldest backups instead of the newest ones.
              ( Tihi ).
         Fix: Display error in debug mode when showing updated GENERAL field.
         Add: Added the setting SHAREALLOTMENT. With this on TRUE, it will
              act as it did before. That is, if the user has 1 gig weekly 
              allotment on the hub, he'll get that on the slave(s) as well
              meaning the user doubles his weekly allotment.
              With it on FALSE, it will simply set the weekly allotment
              to 1000 Kb on the slave(s), thus setting the users CREDITS to
              1 Mb on the slave(s) when the reset bin is executed for new week.
              That means the user have to transfer new credits from the 
              hub to the slave(s) each new week.
         Add: Put the config in a separate file called mss.conf for easier
              upgrades. 

  Update from 1.0: Either reconfigure it, or copy all the settings to a new
                   file called mss.conf. Put it in /glftpd/bin.
                   Add SHAREALLOTMENT=TRUE (or FALSE) to mss.conf.


1:0   :  Initial release.
