Changeset 993 for branches


Ignore:
Timestamp:
Dec 16, 2016, 5:59:30 PM (9 years ago)
Author:
Herwig Bauernfeind
Message:

b4smb: Fix Ticket #278

File:
1 edited

Legend:

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

    r897 r993  
    22  Samba Server for eComStation (OS/2) tools
    33 
    4   (c) 2007-2015 Herwig Bauernfeind for bww bitwise works GmbH.
     4  (c) 2007-2016 Herwig Bauernfeind for bww bitwise works GmbH.
    55  Script:  B4SMB.CMD, requires REXX.
    66  Purpose: This script is executed before the Samba daemons are actually
     
    1010  Syntax:  No parameters.
    1111 */
    12 
    13 ArchLogs =  1 /* Move previous logfiles to archive (by Yuri Dario) */
    14 DelLogs  =  0 /* Remove previous logfiles only */
    15 KeepGens = 10 /* Keep last 10 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 */
     12setupCMD = SysBootDrive()'\MPTN\BIN\Setup.CMD'
     13LANx     = 'lan0' /* Check this interface for a fixed IP */
     14ArchLogs =  1     /* Move previous logfiles to archive (by Yuri Dario) */
     15DelLogs  =  0     /* Remove previous logfiles only */
     16KeepGens = 10     /* Keep last 10 generations of log files, 0 = all */
     17SaveCfg  =  1     /* Save a snapshot of the current Samba configuration */
     18DelTDBs  =  1     /* Remove transient .tdb files */
     19DHCPWait =  1     /* wait until an address was obtained by the DHCP server */
    1920
    2021/* Setup places */
     
    2526
    2627'@echo off'
     28
     29do while lines(SetupCMD) > 0 /* Check LANx interface for fixed IP address */
     30    SL = translate(linein(SetupCMD))
     31    if word(SL,1) = "IFCONFIG" & word(SL,2) = translate(LANx) then do
     32        IP = word(SL,3)
     33        address cmd '@ifconfig 'LANx' | rxqueue'
     34        if queued() = 2 then do
     35            parse pull .
     36            parse pull . IPIFC .
     37            if IPIFC = IP then DHCPWait = 0
     38        end
     39    end
     40end
     41ok = stream(SetupCMD,'c','close')
    2742
    2843if ArchLogs = 1 then do /* Creative logfile archive */
     
    7893    ok = SysFileDelete(SMB_LOCK||'\wins.dat')
    7994    /* Do not remove wins.tdb unless it is damaged */
    80     ok = SysFileDelete(SMB_LOCK||'\wins.tdb')
     95    /* ok = SysFileDelete(SMB_LOCK||'\wins.tdb') */
    8196end
    8297
Note: See TracChangeset for help on using the changeset viewer.