4 * Copyright (C) 2011 shibby
17 char *dir
,*address
,*access
,*sync
,*subtree
,*other
;
20 if( nvram_match( "nfs_enable", "1" ) )
23 // read exports from nvram
24 if ((buf
= strdup(nvram_safe_get("nfs_exports"))) != NULL
) {
26 // writing data to file
27 if( !( fp
= fopen( "/etc/exports", "w" ) ) )
29 perror( "/etc/exports" );
35 // dir < address < access < sync < subtree < other
37 while ((p
= strsep(&g
, ">")) != NULL
) {
38 i
= vstrsep(p
, "<", &dir
, &address
, &access
, &sync
, &subtree
, &other
);
40 fprintf(fp
, "%s %s(%s,%s,%s,%s)\n", dir
,address
,access
,sync
,subtree
,other
);
46 chmod( "/etc/exports", 0644 );
50 xstart( "/usr/sbin/nfs.rc" );
57 killall("portmap", SIGTERM
);
58 killall("statd", SIGTERM
);
59 killall("nfsd", SIGTERM
);
60 killall("mountd", SIGTERM
);