Changeset 283 for branches/scripts/user


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/user/usermod.cmd

    r193 r283  
    11/* UserMod script for Samba Server for eCS (OS/2) */
    2    Version = '2.1.5'
     2   Version = '2.2.0'
    33/* Copyright (C) netlabs.org 2007-2009
    44
     
    3636call _SambaInit
    3737
     38call _SambaExtendSearchPath
     39
    3840parse arg '-'mode' "'User'"'
    3941if User = "" & mode <> "" then parse arg '-'mode' 'User
     
    163165    script = VRParseFileName(script,'N')
    164166
     167    /* smbd.exe */
     168    samba.!smbd = ""
     169    if samba.!smbd = "" then do /* in current directory? */
     170        ok = SysFileTree('.\smbd.exe', exist.,'FO')
     171        if exist.0 = 1 then samba.!smbd = exist.1
     172    end
     173    if samba.!smbd = "" then do /* in parent directory? */
     174        ok = SysFileTree('..\smbd.exe', exist.,'FO')
     175        if exist.0 = 1 then samba.!smbd = exist.1
     176    end
     177    if samba.!smbd = "" then do /* in ..\BIN directory? */
     178        ok = SysFileTree('..\bin\smbd.exe', exist.,'FO')
     179        if exist.0 = 1 then samba.!smbd = exist.1
     180    end
     181    if samba.!smbd = "" then do /* in SMB_EXE ? */
     182        samba.!smbd = SysSearchPath("SMB_EXE","SMBD.EXE")
     183    end
     184    if samba.!smbd = "" then do /* in PATH ? */
     185        samba.!smbd = SysSearchPath("PATH","SMBD.EXE")
     186    end
     187
     188    samba.!bin = VRParseFileName(samba.!smbd,'DP')
     189    if samba.!bin = "" then samba.!bin = samba.!tools
     190
    165191    samba.!pwd_mkdb = SysSearchPath("PATH","pwd_mkdb.exe")
    166192    if samba.!pwd_mkdb = "" then do /* in current directory? */
     
    179205        samba.!pwd_mkdb = SysSearchPath("SMB_SBIN","pwd_mkdb.exe")
    180206    end
     207return
     208
     209_SambaExtendSearchPath:
     210    /* Add binary and tools path to the PATH variable */
     211    old_path = value('PATH',, 'OS2ENVIRONMENT')
     212    if pos(translate(samba.!bin';'),translate(old_path)) = 0 then do
     213        if samba.!bin = samba.!tools then new_path = samba.!bin';'
     214        else new_path = samba.!bin';'samba.!tools';'
     215        ok = value('PATH', new_path || old_path, 'OS2ENVIRONMENT')
     216        drop new_path
     217    end
     218    drop old_path
     219   
     220    /* Add binary and tools path to the BEGINLIBPATH variable */
     221    old_beginlibpath = SysQueryEXtLibPath("B")
     222    if pos(translate(samba.!bin';'),translate(old_beginlibpath)) = 0 then do
     223        if samba.!bin = samba.!tools then new_beginlibpath = samba.!bin';'old_beginlibpath
     224        else new_beginlibpath = samba.!bin';'samba.!tools';'old_beginlibpath
     225        ok = SysSetExtLibPath( new_beginlibpath, "B")
     226        drop new_beginlibpath
     227    end
     228    drop old_beginlibpath
    181229return
    182230
Note: See TracChangeset for help on using the changeset viewer.