#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2017 Stephan Raue (stephan@openelec.tv)

if [ -f /storage/.cache/services/samba.conf ]; then
  . /storage/.cache/services/samba.conf

  if [ "$SAMBA_AUTOSHARE" == "true" ]; then
    /usr/lib/samba/samba-config
    [ -f /run/samba/smbd.pid ] && pkill -HUP smbd
  fi
fi
