daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest Jul 6th, 2012 2 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh -e
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. if [ "$1" = "configure" ]; then
  6.         db_get samba4/server-role || true
  7.         SERVER_ROLE="$RET"
  8.         db_get samba-common/workgroup || true
  9.         DOMAIN="$RET"
  10.         db_get samba4/realm || true
  11.         REALM="$RET"
  12.         # FIXME: Urgh.. ideally samba-tool would be able to update this:
  13.         # Update realm setting and server role setting
  14. #       /usr/share/samba/setoption.pl "realm" "${REALM}"
  15.         /usr/share/samba/setoption.pl "server role" "${SERVER_ROLE}"
  16.  
  17.         # See if we're upgrading from Samba 3
  18.         if [ ! -z "$2" ]; then
  19.                 if dpkg --compare-versions "$2" lt "3.9.0"; then
  20.                         db_get samba4/upgrade-from-v3 || true
  21.                         if [ "$RET" = "true" ]; then
  22.                                 /usr/share/samba/setup/upgrade --realm="$REALM" \
  23.                                     /var/lib/samba /etc/samba/smb.conf.samba3
  24.                         fi
  25.                 else
  26.                         # Upgrade from previous Samba 4 installation
  27.                         if [ -f /etc/samba/smb.conf ]; then
  28.                                 /usr/share/samba/setup/upgradeprovision --full
  29.                         fi
  30.                 fi
  31.         else
  32.                 # Install from scratch
  33.                 # FIXME: if server role == dc, make sure that there are sysvol and
  34.                 # netlogon shares.
  35.                 /usr/share/samba/setup/provision --realm="$REALM" --domain="$DOMAIN" \
  36.                     --server-role="$SERVER_ROLE"
  37.         fi
  38. fi
  39.  
  40. # Automatically added by dh_installinit
  41. if [ -e "/etc/init/samba4.conf" ]; then
  42.         invoke-rc.d samba4 start || exit $?
  43. fi
  44. # End automatically added section
  45.  
  46.  
  47. db_stop
  48.  
  49. exit 0
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top