Changeset 575 for branches/scripts


Ignore:
Timestamp:
Jun 24, 2011, 12:29:45 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

usermod.cmd Ver. 2.3.2: Restore backups in case databases could not be written

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scripts/user/usermod.cmd

    r568 r575  
    11/* UserMod script for Samba Server for eCS (OS/2) */
    2    Version = '2.3.1'
     2   Version = '2.3.2'
    33/* Copyright (C) netlabs.org, Herwig Bauernfeind 2007-2010
    44
     
    374374    address cmd '@echo off'
    375375    address cmd samba.!pwd_mkdb' -d 'unixetc' 'samba.!masterpasswd
     376   
     377    /* Check whether new password db was written */
     378    if \VRFileExists(UnixETC'\pwd.db') | \VRFileExists(UnixETC'\spwd.db') then do
     379        say "Error occured - password db not written - restoring previous set, changes lost!"
     380        ok = VRCopyFile( samba.!masterpasswd'.bak', samba.!masterpasswd )         
     381        ok = VRCopyFile( UnixETC'\pwd.db.bak',  UnixETC'\pwd.db'  )         
     382        ok = VRCopyFile( UnixETC'\spwd.db.bak', UnixETC'\spwd.db' )
     383    end
    376384return
    377385
Note: See TracChangeset for help on using the changeset viewer.