#!/bin/bash
#----------------------------------------------------------------------------
# /var/install/bin/samba-edit - edit /etc/config.d/cui-samba and create new
#                               /etc/smb.conf by /var/install/config.d/cui-samba.sh
#
# Copyright (c) 2002-2013 Thomas Bork, tom(at)eisfair(dot)net
#
# Creation   : 2001-11-04 fm
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------
. /var/install/include/eislib

configfile='/etc/config.d/cui-samba'

clrhome
mecho --info "Edit Samba configuration"
echo

if /var/install/bin/edit ${configfile} ; then
    if /var/install/bin/ask "Activate Samba configuration now" "y" ; then
        # removed - because vfs modules are ignoring sighup of smbd's
        # sh /etc/init.d/samba reload
#        sh /etc/init.d/smbfs stop
        rc-service samba stop
        sh /var/install/config.d/cui-samba.sh
        rc-service samba start
#        sh /etc/init.d/smbfs start
    fi
fi

echo
anykey
