Changeset 4433
- Timestamp:
- 08.03.2010 22:21:00 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/make/samba/files/root/etc/default.samba/samba_conf
r4404 r4433 1 1 #!/bin/sh 2 2 3 CFGCTL= `which usbcfgctl`3 CFGCTL="$(which usbcfgctl)" 4 4 [ -z "$CFGCTL" ] && CFGCTL=ar7cfgctl 5 5 … … 38 38 echo "### default" 39 39 40 if [ "`echo usbhost.samba_server_enabled | $CFGCTL -s`" = "yes" ]; then 41 #if [ "$SAMBA_DEFAULT_SHARE" = "yes" ]; then 42 for SHARE in /var/media/ftp/* ; do 43 if test -d $SHARE ; then 44 SHORTNAME=`basename $SHARE | sed s/-Partition-/-/` 45 echo "[$SHORTNAME]" 46 echo " path = $SHARE" 47 echo " user = ftpuser" 40 if [ "$(echo usbhost.samba_server_enabled | $CFGCTL -s)" = "yes" ]; then 41 for SHARE in /var/media/ftp/*; do 42 if [ -d "$SHARE" ]; then 43 SHORTNAME="$(basename "$SHARE" | sed s/-Partition-/-/)" 44 echo "[$SHORTNAME]" 45 echo " path = $SHARE" 46 echo " user = ftpuser" 48 47 49 if [ "$(echo usbhost.readonly | $CFGCTL -s)" != "yes" ] ; then 50 echo " read only = no" 51 else 52 echo " read only = yes" 48 if [ "$(echo usbhost.readonly | $CFGCTL -s)" = "yes" ]; then 49 echo " read only = yes" 50 else 51 echo " read only = no" 52 fi 53 54 if [ "$(echo usbhost.password | $CFGCTL -s)" = "\"\"" ]; then 55 echo " guest ok = yes" 56 fi 57 58 echo " write cache size = 65536" 53 59 fi 54 55 if [ "$(echo usbhost.password | $CFGCTL -s)" = "\"\"" ] ; then56 echo " guest ok = yes"57 fi58 59 echo " write cache size = 65536"60 fi61 60 done 62 61 fi … … 76 75 esac 77 76 if [ "$options" != "-" ]; then 78 options=${options//\%20/ } 79 options=${options//=/ = } 77 options="$(echo "$options" | sed -r -e 's,=, = ,g;s,(%20| )+, ,g;')" 80 78 else 81 79 options="" 82 80 fi 83 if [[ ! $options =~ "user =" ]]; then 84 options="$options,user = ftpuser" 85 fi 86 if [[ ! $options =~ "write cache size =" ]]; then 87 options="$options,write cache size = 65536" 88 fi 89 options=$(echo -e ${options//,/\\n }) 81 echo "$options" | grep -q "user =" >/dev/null 2>&1 || options="$options,user = ftpuser" 82 echo "$options" | grep -q "write cache size =" >/dev/null 2>&1 || options="$options,write cache size = 65536" 83 options="$(echo -e "${options//,/\\n }")" 90 84 cat << EOF 91 [${name/ %20/ }]85 [${name//%20/ }] 92 86 comment = $comment 93 87 path = $path … … 101 95 102 96 echo "### fin" 103
