Update build clearing of 'modbin' temporary directory.
[lufs.git] / util / auto.ftpfs.c
1 /*
2  * lufsmount.c
3  * Copyright (C) 2002 Florin Malita <mali@go.ro>
4  *
5  * This file is part of LUFS, a free userspace filesystem implementation.
6  * See http://lufs.sourceforge.net/ for updates.
7  *
8  * LUFS is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * LUFS is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include <stdio.h>
24 #include <string.h>
25
26 int
27 main(int argc, char **argv){
28     char *host, *user = NULL, *pass = NULL, *port = NULL;
29     char *c;
30
31     if(argc < 2)
32         return 1;
33
34     if(!(c = strchr(argv[1], '@'))){
35         host = argv[1];
36     }else{
37         *c = 0;
38         host = c + 1;
39         user = argv[1];
40
41         if((c = strchr(user, ':'))){
42             *c = 0;
43             pass = c + 1;
44         }
45     }
46
47     if((c = strchr(host, ':'))){
48         *c = 0;
49         port = c + 1;
50     }
51
52     printf("-fstype=lufs,fs=ftpfs,quiet,host=%s", host);
53     
54     if(user)
55         printf(",username=%s", user);
56     if(pass)
57         printf(",password=%s", pass);
58     if(port)
59         printf(",port=%s", port);
60
61     printf(" none\n");
62
63     return 0;
64 }
65