mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
-
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# install samba
|
|
|
|
nawk '/^netbios-[ns]*[ ]/ {next}
|
|
{print}
|
|
END { print "netbios-ssn 139/tcp"
|
|
print "netbios-ns 137/udp # samba service" }' \
|
|
${PKG_INSTALL_ROOT}/etc/inet/services > /tmp/services.$$ && \
|
|
mv -f /tmp/services.$$ ${PKG_INSTALL_ROOT}/etc/inet/services &&
|
|
\
|
|
chmod 644 ${PKG_INSTALL_ROOT}/etc/inet/services && \
|
|
echo "Updated ${PKG_INSTALL_ROOT}/etc/inet/services"
|
|
|
|
nawk '/samba.*mbd[ ]/ { next }
|
|
{print}
|
|
END { print "# samba connections are handled by smbd and nmbd"
|
|
print "netbios-ssn stream tcp nowait root /opt/samba/bin/smbd
|
|
smbd"
|
|
print "netbios-ns dgram udp wait root /opt/samba/bin/nmbd nmbd" }'
|
|
\
|
|
${PKG_INSTALL_ROOT}/etc/inet/inetd.conf > /tmp/inetd.conf.$$ &&
|
|
\
|
|
mv -f /tmp/inetd.conf.$$ ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf
|
|
&& \
|
|
chmod 644 ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf && \
|
|
echo "Updated ${PKG_INSTALL_ROOT}/etc/inet/inetd.conf"
|
|
|
|
echo "Installed samba service into ${PKG_INSTALL_ROOT:-/}"
|
|
|
|
inetpid=`/bin/ps -ef | awk '/ \/usr\/sbin\/inetd / { print $2 } '`
|
|
if [ "X$inetpid" = "X" ]; then
|
|
echo "inetd not running"
|
|
else
|
|
echo "Restarting inetd($inetpid)"
|
|
kill -HUP $inetpid
|
|
fi
|
|
|