Changeset 275
- Timestamp:
- Jun 17, 2009, 4:18:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/guitools-1.0/shared/sambainit.vrs
r269 r275 11 11 /* Error status and file variables */ 12 12 ErrorFile = Tempdir'smbutil.error' 13 ErrorState = 0 /* _ErrorNotFound() changes this variable */ 13 ErrorState = 0 /* _ErrorBinaryNotFound() changes this variable */ 14 DataErrorState = 0 /* _ErrorDataFileNotFound() changes this variable */ 14 15 15 16 /* Evaluate environment */ … … 83 84 end 84 85 85 if samba.!smbd = "" then call _Error NotFound " could not find smbd.exe!"86 if samba.!smbd = "" then call _ErrorBinaryNotFound " could not find smbd.exe!" 86 87 87 88 samba.!bin = VRParseFileName(samba.!smbd,'DP') … … 92 93 if \VRFileExists(samba.!smbcmd) then do 93 94 samba.!smbcmd = samba.!bin'\smb.cmd' 94 if \VRFileExists(samba.!smbcmd) then call _Error NotFound " could not find smb.cmd!"95 if \VRFileExists(samba.!smbcmd) then call _ErrorBinaryNotFound " could not find smb.cmd!" 95 96 end 96 97 IF options.!debug == 1 THEN say ' smb.cmd = "'samba.!smbcmd'"' … … 98 99 /* smbpasswd.exe */ 99 100 samba.!smbpasswdexe = samba.!bin'\smbpasswd.exe' 100 if \VRFileExists(samba.!smbpasswdexe) then call _Error NotFound " could not find smbpasswd.exe!"101 if \VRFileExists(samba.!smbpasswdexe) then call _ErrorBinaryNotFound " could not find smbpasswd.exe!" 101 102 IF options.!debug == 1 THEN say ' smbpasswd.exe = "'samba.!smbpasswdexe'"' 102 103 103 104 /* pdbedit.exe */ 104 105 samba.!pdbeditexe = samba.!bin'\pdbedit.exe' 105 if \VRFileExists(samba.!pdbeditexe) then call _Error NotFound " could not find pdbedit.exe!"106 if \VRFileExists(samba.!pdbeditexe) then call _ErrorBinaryNotFound " could not find pdbedit.exe!" 106 107 IF options.!debug == 1 THEN say ' pdbedit.exe = "'samba.!pdbeditexe'"' 107 108 108 109 /* net.exe */ 109 110 samba.!netexe = samba.!bin'\net.exe' 110 if \VRFileExists(samba.!netexe) then call _Error NotFound " could not find net.exe!"111 if \VRFileExists(samba.!netexe) then call _ErrorBinaryNotFound " could not find net.exe!" 111 112 IF options.!debug == 1 THEN say ' net.exe = "'samba.!netexe'"' 112 113 113 114 /* testparm.exe */ 114 115 samba.!testparmexe = samba.!bin'\testparm.exe' 115 if \VRFileExists(samba.!testparmexe) then call _Error NotFound " could not find testparm.exe!"116 if \VRFileExists(samba.!testparmexe) then call _ErrorBinaryNotFound " could not find testparm.exe!" 116 117 IF options.!debug == 1 THEN say ' testparm.exe = "'samba.!testparmexe'"' 117 118 118 119 /* smbtree.exe */ 119 120 samba.!smbtreeexe = samba.!bin'\smbtree.exe' 120 if \VRFileExists(samba.!smbtreeexe) then call _Error NotFound " could not find smbtree.exe!"121 if \VRFileExists(samba.!smbtreeexe) then call _ErrorBinaryNotFound " could not find smbtree.exe!" 121 122 IF options.!debug == 1 THEN say ' smbtree.exe = "'samba.!smbtreeexe'"' 122 123 123 124 /* smbstatus.exe */ 124 125 samba.!smbstatusexe = samba.!bin'\smbstatus.exe' 125 if \VRFileExists(samba.!smbstatusexe) then call _Error NotFound " could not find smbstatus.exe!"126 if \VRFileExists(samba.!smbstatusexe) then call _ErrorBinaryNotFound " could not find smbstatus.exe!" 126 127 IF options.!debug == 1 THEN say ' smbstatus.exe = "'samba.!smbstatusexe'"' 127 128 128 129 /* smbcontrol.exe */ 129 130 samba.!smbcontrolexe = samba.!bin'\smbcontrol.exe' 130 if \VRFileExists(samba.!smbcontrolexe) then call _Error NotFound " could not find smbcontrol.exe!"131 if \VRFileExists(samba.!smbcontrolexe) then call _ErrorBinaryNotFound " could not find smbcontrol.exe!" 131 132 IF options.!debug == 1 THEN say ' smbcontrol.exe = "'samba.!smbcontrolexe'"' 132 133 133 134 /* smbclient.exe */ 134 135 samba.!smbclientexe = samba.!bin'\smbclient.exe' 135 if \VRFileExists(samba.!smbclientexe) then call _Error NotFound " could not find smbclient.exe!"136 if \VRFileExists(samba.!smbclientexe) then call _ErrorBinaryNotFound " could not find smbclient.exe!" 136 137 IF options.!debug == 1 THEN say ' smbclient.exe = "'samba.!smbclientexe'"' 137 138 … … 158 159 end 159 160 160 if samba.!pwd_mkdb = "" then call _Error NotFound " could not find pwd_mkdb.exe!"161 if samba.!pwd_mkdb = "" then call _ErrorBinaryNotFound " could not find pwd_mkdb.exe!" 161 162 IF options.!debug == 1 THEN say ' pwd_mkdb.exe = "'samba.!pwd_mkdb'"' 162 163 … … 175 176 end 176 177 177 if samba.!log = "" then call _Error NotFound " could not find logfiles!"178 if samba.!log = "" then call _ErrorDataFileNotFound " could not find logfiles!" 178 179 IF options.!debug == 1 THEN say ' Samba logfiles = "'samba.!log'"' 179 180 180 181 /* smb.conf */ 181 182 samba.!smbconf = ETC'\samba\smb.conf' 182 ok = stream(samba.!smbconf,'c','query exists') 183 if ok = "" then do 184 call _ErrorNotFound samba.!smbconf' is not present.' 185 end 183 if \VRFileExists(samba.!smbconf) then call _ErrorDataFileNotFound samba.!smbconf' is not present.' 186 184 IF options.!debug == 1 THEN say ' Samba smb.conf = "'samba.!smbconf'"' 187 185 … … 189 187 /* the password files - we'll create them if they don't exist */ 190 188 samba.!masterpasswd = unixetc'\master.passwd' 189 if \VRFileExists(samba.!masterpasswd) then call _ErrorDataFileNotFound " could not find master.passwd!" 191 190 IF options.!debug == 1 THEN say ' master.passwd = "'samba.!masterpasswd'"' 192 if \VRFileExists(samba.!masterpasswd) then call _ErrorNotFound " could not find master.passwd!"193 191 194 192 samba.!pwddb = unixetc'\pwd.db' 193 if \VRFileExists(samba.!pwddb) then call _ErrorDataFileNotFound " could not find pwd.db!" 195 194 IF options.!debug == 1 THEN say ' pwd.db = "'samba.!pwddb'"' 196 if \VRFileExists(samba.!pwddb) then call _ErrorNotFound " could not find pwd.db!"197 195 198 196 samba.!spwddb = unixetc'\spwd.db' 197 if \VRFileExists(samba.!spwddb) then call _ErrorDataFileNotFound " could not find spwd.db!" 199 198 IF options.!debug == 1 THEN say ' spwd.db = "'samba.!spwddb'"' 200 if \VRFileExists(samba.!spwddb) then call _ErrorNotFound " could not find spwd.db!"201 199 202 200 samba.!group = unixetc'\group' 201 if \VRFileExists(samba.!group) then call _ErrorDataFileNotFound " could not find "samba.!group"!" 203 202 IF options.!debug == 1 THEN say ' group = "'samba.!group'"' 204 if \VRFileExists(samba.!group) then call _ErrorNotFound " could not find "samba.!group"!"205 203 206 204 samba.!printcap = unixetc'\printcap' 205 if \VRFileExists(samba.!spwddb) then call _ErrorDataFileNotFound " could not find printcap!" 207 206 IF options.!debug == 1 THEN say ' printcap = "'samba.!printcap'"' 208 if \VRFileExists(samba.!spwddb) then call _ErrorNotFound " could not find printcap!"209 207 210 208 /* Create this directory tree if it does not exist */ … … 239 237 /* Do some very basic housekeeping when leaving */ 240 238 ok = stream(samba.!msg,'c','close') 241 ok = stream(samba.!err ,'c','close')239 ok = stream(samba.!error,'c','close') 242 240 ok = SysFileDelete(samba.!msg) 243 ok = SysFileDelete(samba.!err )241 ok = SysFileDelete(samba.!error) 244 242 return 245 243 246 244 /*:VRX */ 247 _Error NotFound:245 _ErrorBinaryNotFound: 248 246 /* Set error status variable and show a short message - incomplete! */ 249 247 msg = arg(1) 250 248 say "ERROR: "msg 249 id = VRMessage( VRWindow(), msg, "Samba Installation", "E" ) 251 250 ErrorState = (1|ErrorState) 251 return 252 253 /*:VRX */ 254 _ErrorDataFileNotFound: 255 /* Set error status variable and show a short message - incomplete! */ 256 msg = arg(1) 257 say "ERROR: "msg 258 DataErrorState = (1|DataErrorState) 252 259 return 253 260
Note:
See TracChangeset
for help on using the changeset viewer.