#!/bin/sh ## ## Samba: Convert share definitions in a TSV into the smb.conf ## Copyright (c) 2006-2007 SATOH Fumiyasu @ OSS Technology Co., Japan ## ## Date: 2007-03-07, since 2006-??-?? ## License: GNU General Public License version 2 ## ## Usage: tsv2smbconf smb.conf ## ## 1 sharename ## 2 path ## 3 memo ## 4 comment ## 5 browse ok ## 6 valid users ## 7 invalid users ## 8 guest ok ## 9 write ok ## 10 write list ## 11 read list exec awk -F '\t' ' BEGIN { ORS="" } length($1) > 0 { print "\n" if (length($3)) print "## "$3"\n" print "["$1"]\npath = "$2"\n" if (length($4)) print "comment = "$4"\n" if (length($5)) print "browseable = "$5"\n" if (length($6)) print "valid users = "$6"\n" if (length($7)) print "invalid users = "$7"\n" if (length($8)) print "guest ok = "$8"\n" if (length($9)) print "writeable = "$9"\n" if (length($10)) print "write list = "$10"\n" if (length($11)) print "read list = "$11"\n" } '