Changeset 29354 for packages


Ignore:
Timestamp:
2011-11-29T11:35:57+01:00 (5 years ago)
Author:
jow
Message:

[packages] samba3: expose interfaces configuration in uci, move generated smb.conf to /var/etc, bump pkg release

Location:
packages/net/samba3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • packages/net/samba3/Makefile

    r29347 r29354  
    99PKG_NAME:=samba3 
    1010PKG_VERSION:=3.0.37 
    11 PKG_RELEASE:=2 
     11PKG_RELEASE:=3 
    1212 
    1313PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289 
  • packages/net/samba3/files/samba.config

    r12278 r29354  
    44        option 'description'    'openwrt' 
    55        option 'homes'                  '1' 
     6        list 'interface'                'lo' 
     7        list 'interface'                'lan' 
    68                 
    79config sambashare 
  • packages/net/samba3/files/samba.init

    r29343 r29354  
    99        local description 
    1010        local homes 
     11        local interface 
    1112 
    1213        config_get name $1 name 
     
    1415        config_get description $1 description 
    1516        config_get homes $1 homes 
     17        config_get interface $1 interface "lan" 
     18 
     19        # resolve interfaces 
     20        local interfaces=$( 
     21                include /lib/network 
     22                scan_interfaces 
     23                local net ifname; for net in $interface; do 
     24                        config_get ifname "$net" ifname "$net" 
     25                        echo -n "$ifname " 
     26                done 
     27        ) 
    1628 
    1729        [ -z "$name" ] && name=openwrt 
     
    1931        [ -z "$description" ] && description=openwrt 
    2032 
    21         cp /etc/samba/smb.conf.template /tmp/smb.conf 
    22         [ -L /etc/samba/smb.conf ] || ln -nsf /tmp/smb.conf /etc/samba/smb.conf 
    23         sed -i "s/|NAME|/$name/g" /tmp/smb.conf 
    24         sed -i "s/|WORKGROUP|/$workgroup/g" /tmp/smb.conf 
    25         sed -i "s/|DESCRIPTION|/$description/g" /tmp/smb.conf 
     33        mkdir -p /var/etc 
     34        cp /etc/samba/smb.conf.template /var/etc/smb.conf 
     35        [ -L /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf 
     36        sed -i "s/|NAME|/$name/g" /var/etc/smb.conf 
     37        sed -i "s/|WORKGROUP|/$workgroup/g" /var/etc/smb.conf 
     38        sed -i "s/|DESCRIPTION|/$description/g" /var/etc/smb.conf 
     39        sed -i "s/|INTERFACES|/$interfaces/g" /var/etc/smb.conf 
    2640        [ "$homes" == "1" ] && { 
    27                 echo -e "\n[homes]\n\tcomment = Home Directories\n\tbrowseable = no\n\tread only = no\n\tcreate mode = 0750" >> /tmp/smb.conf 
     41                echo -e "\n[homes]\n\tcomment = Home Directories\n\tbrowseable = no\n\tread only = no\n\tcreate mode = 0750" >> /var/etc/smb.conf 
    2842        } 
    2943} 
     
    4862        [ -z "$name" -o -z "$path" ] && return 
    4963 
    50         echo -e "\n[$name]\n\tpath = $path" >> /tmp/smb.conf 
    51         [ -n "$users" ] && echo -e "\tvalid users = $users" >> /tmp/smb.conf 
    52         [ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /tmp/smb.conf 
    53         [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /tmp/smb.conf 
    54         [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /tmp/smb.conf 
    55         [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /tmp/smb.conf 
     64        echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf 
     65        [ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf 
     66        [ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf 
     67        [ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf 
     68        [ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf 
     69        [ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf 
    5670} 
    5771 
  • packages/net/samba3/files/smb.conf.template

    r29347 r29354  
    1515        invalid users = root 
    1616        smb passwd file = /etc/samba/smbpasswd 
     17        interfaces = |INTERFACES| 
Note: See TracChangeset for help on using the changeset viewer.