Changeset 897


Ignore:
Timestamp:
Mar 21, 2016, 2:18:50 PM (5 years ago)
Author:
Herwig Bauernfeind
Message:

smb.cmd: Fix crash on uninterpretable smb.conf parm

Location:
branches/scripts/smb_init
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/scripts/smb_init/b4smb.cmd

    r886 r897  
    1111 */
    1212
    13 ArchLogs = 1 /* Move previous logfiles to archive (by Yuri Dario) */
    14 DelLogs  = 0 /* Remove previous logfiles only */
    15 KeepGens = 5 /* Keep last 5 generations of log files, 0 = all */
    16 SaveCfg  = 1 /* Save a snapshot of the current Samba configuration */
    17 DelTDBs  = 1 /* Remove transient .tdb files */
    18 DHCPWait = 1 /* wait until an address was obtained by the DHCP server */
     13ArchLogs =  1 /* Move previous logfiles to archive (by Yuri Dario) */
     14DelLogs  =  0 /* Remove previous logfiles only */
     15KeepGens = 10 /* Keep last 10 generations of log files, 0 = all */
     16SaveCfg  =  1 /* Save a snapshot of the current Samba configuration */
     17DelTDBs  =  1 /* Remove transient .tdb files */
     18DHCPWait =  1 /* wait until an address was obtained by the DHCP server */
    1919
    2020/* Setup places */
     
    2828if ArchLogs = 1 then do /* Creative logfile archive */
    2929    ok = SysMkDir(SMB_LOGS'\Archive')
    30     Archive = SMB_LOGS||'\Archive\'||date('s')||'-'||translate(time('n'),'-',':')||".zip"
     30    Archive = SMB_LOGS||'\Archive\logarc-'||date('S')'-'right('0'||time('M'),4)
    3131    address cmd' zip -jmo9 'Archive' 'SMB_LOGS'\log.?mbd* 'SMB_LOGS'\log.winb*'
    3232    if KeepGens > 0 then do /* Eventually purge old logfile archives */
    33         ok = SysFileTree(SMB_LOGS||'\Archive\*.zip',logarchs.,"FO")
     33        ok = SysFileTree(SMB_LOGS||'\Archive\logarc*.zip',logarchs.,"FO")
    3434        if logarchs.0 > KeepGens then do
    3535            do I = 1 to (logarchs.0-KeepGens)
     
    5050    ok = SysMkDir(ETC'\SmbBackup')
    5151    Backup = ETC'\SmbBackup\smbcfg-'date('S')'-'right('0'||time('M'),4)
    52     address cmd' zip -rpo9 'Backup' 'ETC'\samba\* 'UNIXETC'\*pwd* 'UNIXETC'\*passw* -x 'ETC'\samba\*.zip >SmbBackup'
     52    address cmd' zip -rpo9 'Backup' 'ETC'\samba\* 'UNIXETC'\*pwd* 'UNIXETC'\*passw* -x 'ETC'\samba\*.zip 'ETC'\samba\log\log* >SmbBackup'
     53    if KeepGens > 0 then do /* Eventually purge old snapshots */
     54        ok = SysFileTree(ETC'\SmbBackup\smbcfg-*',snapshots.,"FO")
     55        if snapshots.0 > KeepGens then do
     56            do I = 1 to (snapshots.0-KeepGens)
     57                address cmd' del "'snapshots.I
     58            end
     59        end
     60    end
    5361end
    5462
     
    7381end
    7482
    75 if WaitDHCP then do /* Make sure we got network interfaces up and running */
     83if DHCPWait then do /* Make sure we got network interfaces up and running */
    7684    address cmd' dhcpstrt'
    7785end
  • branches/scripts/smb_init/smb.cmd

    r844 r897  
    1 /* Samba Server for eCS (OS/2) init script Version 3.1.8
    2    Copyright (C) netlabs.org 2007-2012
     1/* Samba Server for eCS (OS/2) init script Version 3.1.9
     2   Copyright (C) bww bitwise works GmbH. 2007-2016
    33
    44   This program is free software; you can redistribute it and/or modify
     
    517517            istr = sections.s'.0='p
    518518            interpret istr
    519             nextone:
    520         end
    521     end
     519        end
     520        nextone:
     521        signal on syntax name endloop
     522    end
     523    endloop:
    522524    ok = stream(samba.!smbconf,'c','close')
    523525return 0
Note: See TracChangeset for help on using the changeset viewer.