JHT ===> Added Sun Solaris binary package building spec files contributed
[kai/samba.git] / packaging / Solaris / pkg-specs / postinstall
1 #!/bin/sh
2 # install samba
3
4 nawk '/^netbios-[ns]*[  ]/ {next}
5 {print}
6 END { print "netbios-ssn        139/tcp"
7         print "netbios-ns       137/udp # samba service" }' \
8         ${PKG_INSTALL_ROOT}/etc/inet/services > /tmp/services.$$ && \
9         mv -f /tmp/services.$$ ${PKG_INSTALL_ROOT}/etc/inet/services &&
10 \
11         chmod 644 ${PKG_INSTALL_ROOT}/etc/inet/services && \
12         echo "Updated ${PKG_INSTALL_ROOT}/etc/inet/services"
13
14 nawk '/samba.*mbd[      ]/ { next }
15 {print}
16 END { print "# samba connections are handled by smbd and nmbd"
17       print "netbios-ssn stream tcp nowait root /opt/samba/bin/smbd
18 smbd"
19       print "netbios-ns dgram udp wait root /opt/samba/bin/nmbd nmbd" }'
20 \
21         ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf > /tmp/inetd.conf.$$ &&
22 \
23         mv -f /tmp/inetd.conf.$$ ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf
24 && \
25         chmod 644 ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf && \
26         echo "Updated ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf"
27
28 echo "Installed samba service into ${PKG_INSTALL_ROOT:-/}" 
29  
30 inetpid=`/bin/ps -ef | awk '/ \/usr\/sbin\/inetd / { print $2 } '`
31 if [ "X$inetpid" = "X" ]; then
32    echo "inetd not running"
33 else
34    echo "Restarting inetd($inetpid)"
35    kill -HUP $inetpid
36 fi
37