| Server IP : 20.75.53.88 / Your IP : 216.73.217.72 [ Web Server : Apache System : Linux VMRALP-3 4.4.0-256-generic #290~14.04.1-Ubuntu SMP Thu Jun 20 09:24:50 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29+esm15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Domains : 3 Domains MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/lib/dpkg/info/ |
Upload File : |
#!/bin/sh
#
#
set -e
# Do debconf stuff here
. /usr/share/debconf/confmodule
TEMPDIR=/var/run/samba/upgrades
NEWFILE=$TEMPDIR/smb.conf
CONFIG=/etc/samba/smb.conf
# ------------------------- Debconf questions start ---------------------
configure_smb_conf() {
local CONFIG
CONFIG="$1"
# Is the user configuring with debconf, or he/she prefers
# swat/manual config?
db_get samba-common/do_debconf || true
if [ "${RET}" != "true" ]; then
return 0
fi
# Get workgroup name
db_get samba-common/workgroup || true
WORKGROUP="${RET}"
# Oh my GOD, this is ugly. Why would anyone put these
# characters in a workgroup name? Why, Lord, why???
WORKGROUP=`echo $WORKGROUP | \
sed -e's/\\\\/\\\\\\\\/g
s#/#\\\\/#g
s/&/\\\&/g
s/\\\$/\\\\\\\$/g'`
sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ \
s/^\([[:space:]]*\)workgroup[[:space:]]*=.*/\1workgroup = ${WORKGROUP}/i" \
"$CONFIG"
# Install DHCP support
db_get samba-common/dhcp
if [ "$RET" = true ] && \
! grep -q dhcp.conf "$CONFIG"
then
sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ {
/wins server[[:space:]]*=/a \\
\\
# If we receive WINS server info from DHCP, override the options above. \\
include = /etc/samba/dhcp.conf
}" "$CONFIG"
elif [ "$RET" != true ]; then
sed -i -e '
/^#[[:space:]]*If we receive WINS server info from DHCP, override the options above/d
/^#*[[:space:]]*include[[:space:]]*=[[:space:]]*\/etc\/samba\/dhcp.conf/,/[^[:space:]]/ {
/^#*[[:space:]]*include[[:space:]]*=[[:space:]]*\/etc\/samba\/dhcp.conf/d
/^[[:space:]]*$/d
}' "$CONFIG"
fi
}
if [ -e "$CONFIG" ]; then
configure_smb_conf "$CONFIG"
fi
mkdir -p "$TEMPDIR"
cp /usr/share/samba/smb.conf "$NEWFILE"
configure_smb_conf "$NEWFILE"
if [ -e "$CONFIG" ]; then
sed -e '1,/^[;#[:space:]]*\[cdrom\]/ { d }
1,/^[[:space:]]*\[/ { /^[^[]/d; /^$/d }
' "$CONFIG" >> "$NEWFILE"
fi
ucf --three-way --debconf-ok "$NEWFILE" "$CONFIG"
if [ ! -e "$CONFIG" ]; then
echo "Install/upgrade will fail. To recover, please try:"
echo " sudo cp /usr/share/samba/smb.conf $CONFIG"
echo " sudo dpkg --configure -a"
else
ucfr samba-common "$CONFIG"
chmod a+r "$CONFIG"
fi
# ------------------------- Debconf questions end ---------------------
db_stop
# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/dhcp3/dhclient-enter-hooks.d/samba /etc/dhcp/dhclient-enter-hooks.d/samba 2:4.1.4+dfsg-2~ -- "$@"
# End automatically added section
# Clean up the now-empty dir which our conffile was previously in,
# since it wasn't empty at the time dpkg could automatically remove it
# for us.
if dpkg --compare-versions "$2" lt-nl 2:4.1.4+dfsg-2~
then
rmdir -p --ignore-fail-on-non-empty /etc/dhcp3/dhclient-enter-hooks.d
fi