Changeset 283 for branches/scripts/user
- Timestamp:
- Jun 24, 2009, 2:42:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scripts/user/usermod.cmd
r193 r283 1 1 /* UserMod script for Samba Server for eCS (OS/2) */ 2 Version = '2. 1.5'2 Version = '2.2.0' 3 3 /* Copyright (C) netlabs.org 2007-2009 4 4 … … 36 36 call _SambaInit 37 37 38 call _SambaExtendSearchPath 39 38 40 parse arg '-'mode' "'User'"' 39 41 if User = "" & mode <> "" then parse arg '-'mode' 'User … … 163 165 script = VRParseFileName(script,'N') 164 166 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 165 191 samba.!pwd_mkdb = SysSearchPath("PATH","pwd_mkdb.exe") 166 192 if samba.!pwd_mkdb = "" then do /* in current directory? */ … … 179 205 samba.!pwd_mkdb = SysSearchPath("SMB_SBIN","pwd_mkdb.exe") 180 206 end 207 return 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 181 229 return 182 230
Note:
See TracChangeset
for help on using the changeset viewer.