130 |
|
cerr << (!config.hosts.empty() ? "}\n" : ""); |
131 |
|
} |
132 |
|
|
133 |
+ |
if (make) |
134 |
+ |
{ |
135 |
+ |
for (set<string>::iterator itor = makes.begin(); itor != makes.end(); |
136 |
+ |
itor++) |
137 |
+ |
{ |
138 |
+ |
Maker maker(*itor); |
139 |
+ |
|
140 |
+ |
maker.make(); |
141 |
+ |
} |
142 |
+ |
} |
143 |
+ |
|
144 |
+ |
if (mount) |
145 |
+ |
{ |
146 |
+ |
for (set<string>::iterator itor = mounts.begin(); itor != mounts.end(); |
147 |
+ |
itor++) |
148 |
+ |
{ |
149 |
+ |
Mounter mounter(*itor); |
150 |
+ |
|
151 |
+ |
mounter.mount(); |
152 |
+ |
} |
153 |
+ |
} |
154 |
+ |
|
155 |
|
return 0; |
156 |
|
} |
157 |
|
|
205 |
|
|
206 |
|
do |
207 |
|
{ |
208 |
< |
// |
208 |
> |
string line; |
209 |
> |
|
210 |
> |
getline(fin, line); |
211 |
> |
|
212 |
> |
if (line.find('#') == 0 || line == "") |
213 |
> |
{ |
214 |
> |
// ignore |
215 |
> |
} |
216 |
> |
else if (line.find("smbclient=") == 0) |
217 |
> |
{ |
218 |
> |
config.smbclient = line.substr(10); |
219 |
> |
} |
220 |
> |
else if (line.find("mount=") == 0) |
221 |
> |
{ |
222 |
> |
config.mount = line.substr(6); |
223 |
> |
} |
224 |
> |
else if (line.find("root=") == 0) |
225 |
> |
{ |
226 |
> |
config.root = line.substr(5); |
227 |
> |
} |
228 |
> |
else if (line.find("host=") == 0) |
229 |
> |
{ |
230 |
> |
string host = line.substr(5); |
231 |
> |
|
232 |
> |
getline(fin, line); |
233 |
> |
|
234 |
> |
if (line != "{") |
235 |
> |
{ |
236 |
> |
cerr << program << ": Munged configuration for " << host |
237 |
> |
<< "\n"; |
238 |
> |
exit(1); |
239 |
> |
} |
240 |
> |
|
241 |
> |
do |
242 |
> |
{ |
243 |
> |
getline(fin, line); |
244 |
> |
|
245 |
> |
if (line.find("\t#") == 0) |
246 |
> |
{ |
247 |
> |
// ignore |
248 |
> |
} |
249 |
> |
else if (line.find('\t') == 0) |
250 |
> |
{ |
251 |
> |
config.hosts.insert(pair<string, string>(host, |
252 |
> |
line.substr(1))); |
253 |
> |
} |
254 |
> |
else if (line == "}") |
255 |
> |
{ |
256 |
> |
break; |
257 |
> |
} |
258 |
> |
} |
259 |
> |
while (fin.good()); |
260 |
> |
} |
261 |
|
} |
262 |
|
while (fin.good()); |
263 |
|
|