Changeset 283 for branches/scripts/group


Ignore:
Timestamp:
Jun 24, 2009, 2:42:01 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

smb.cmd: Check if master.passwd exists, give hints in case of error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scripts/group/groupmod.cmd

    r193 r283  
    11/* GroupMod script for Samba Server for eCS (OS/2) */
    2    Version = '2.1.3'
     2   Version = '2.2.0'
    33/* Copyright (C) netlabs.org 2007-2009
    44
     
    3737call _SambaInit
    3838
     39call _SambaExtendSearchPath
     40
    3941parse arg '-'mode' "'group'"'
    4042if group = "" & mode <> "" then parse arg '-'mode' 'group
     
    140142    script = VRParseFileName(script,'N')
    141143
     144    /* smbd.exe */
     145    samba.!smbd = ""
     146    if samba.!smbd = "" then do /* in current directory? */
     147        ok = SysFileTree('.\smbd.exe', exist.,'FO')
     148        if exist.0 = 1 then samba.!smbd = exist.1
     149    end
     150    if samba.!smbd = "" then do /* in parent directory? */
     151        ok = SysFileTree('..\smbd.exe', exist.,'FO')
     152        if exist.0 = 1 then samba.!smbd = exist.1
     153    end
     154    if samba.!smbd = "" then do /* in ..\BIN directory? */
     155        ok = SysFileTree('..\bin\smbd.exe', exist.,'FO')
     156        if exist.0 = 1 then samba.!smbd = exist.1
     157    end
     158    if samba.!smbd = "" then do /* in SMB_EXE ? */
     159        samba.!smbd = SysSearchPath("SMB_EXE","SMBD.EXE")
     160    end
     161    if samba.!smbd = "" then do /* in PATH ? */
     162        samba.!smbd = SysSearchPath("PATH","SMBD.EXE")
     163    end
     164
     165    samba.!bin = VRParseFileName(samba.!smbd,'DP')
     166    if samba.!bin = "" then samba.!bin = samba.!tools
     167
    142168    samba.!pwd_mkdb = SysSearchPath("PATH","pwd_mkdb.exe")
    143169    if samba.!pwd_mkdb = "" then do /* in current directory? */
     
    156182        samba.!pwd_mkdb = SysSearchPath("SMB_SBIN","pwd_mkdb.exe")
    157183    end
     184return
     185
     186_SambaExtendSearchPath:
     187    /* Add binary and tools path to the PATH variable */
     188    old_path = value('PATH',, 'OS2ENVIRONMENT')
     189    if pos(translate(samba.!bin';'),translate(old_path)) = 0 then do
     190        if samba.!bin = samba.!tools then new_path = samba.!bin';'
     191        else new_path = samba.!bin';'samba.!tools';'
     192        ok = value('PATH', new_path || old_path, 'OS2ENVIRONMENT')
     193        drop new_path
     194    end
     195    drop old_path
     196   
     197    /* Add binary and tools path to the BEGINLIBPATH variable */
     198    old_beginlibpath = SysQueryExtLibPath("B")
     199    if pos(translate(samba.!bin';'),translate(old_beginlibpath)) = 0 then do
     200        if samba.!bin = samba.!tools then new_beginlibpath = samba.!bin';'old_beginlibpath
     201        else new_beginlibpath = samba.!bin';'samba.!tools';'old_beginlibpath
     202        ok = SysSetExtLibPath( new_beginlibpath, "B")
     203        drop new_beginlibpath
     204    end
     205    drop old_beginlibpath
    158206return
    159207
Note: See TracChangeset for help on using the changeset viewer.