mirror of
https://git.busybox.net/buildroot.git
synced 2024-12-12 23:03:29 +08:00
5f617ffa17
test a == b is not available in e.g. dash. Command(s) used for editing: q=\[\"\'\] operand="${q}?[$]?[a-zA-Z0-9_\?]+${q}?" ## doesn't detect ${VAR} test_expr="(\[\s+${operand}\s+)==(\s+${operand}\s+\])" find . -type f -name '[SK][0-9][0-9]*' | \ xargs sed -r -e "s@${test_expr}@\1=\2@g" -i Signed-off-by: André Erdmann <dywi@mailerd.de> Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
57 lines
801 B
Bash
57 lines
801 B
Bash
#!/bin/sh
|
|
|
|
[ -f /etc/samba/smb.conf ] || exit 0
|
|
|
|
mkdir -p /var/log/samba
|
|
|
|
start() {
|
|
echo -n "Starting SMB services: "
|
|
smbd -D
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
echo -n "Starting NMB services: "
|
|
nmbd -D
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
stop() {
|
|
echo -n "Shutting down SMB services: "
|
|
kill -9 `pidof smbd`
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
echo -n "Shutting down NMB services: "
|
|
kill -9 `pidof nmbd`
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
reload() {
|
|
echo -n "Reloading smb.conf file: "
|
|
kill -HUP `pidof smbd`
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
restart
|
|
;;
|
|
reload)
|
|
reload
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|