| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Author: Steven Shiau <steven _at_ clonezilla org> |
| 3 | # License: GPL |
| 4 | # Description: Generate some deb configs before install it so the user won't be |
| 5 | # asked to input. We will configure them in drblpush. So some |
| 6 | # preconfig data are just temp. |
| 7 | |
| 8 | # dhcp3-server isc-dhcp-server tftpd-hpa nfs-kernel-server nis |
| 9 | |
| 10 | # Load DRBL setting and functions |
| 11 | DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}" |
| 12 | |
| 13 | . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions |
| 14 | |
| 15 | # Settings |
| 16 | DEBCONF=/var/cache/debconf/config.datscip-shell filesystem . . `/var/cache/debconf/config.dat`. |
| 17 | DEFAULT_NIS=/etc/default/nisscip-shell filesystem . . `/etc/default/nis`. |
| 18 | set_etc_nis="no" |
| 19 | [scip-shell system . . `[`. ! -f "$DEBCONF" ] && mkdirscip-shell system . . mkdir. -p "$(dirnamescip-shell system . . dirname. $DEBCONF)" |
| 20 | |
| 21 | ocs_file="$0" |
| 22 | ocs=`basenamescip-shell system . . basename. $ocs_file` |
| 23 | # |
| 24 | while [scip-shell system . . `[`. $# -gt 0 ]; do |
| 25 | case "$1" in |
| 26 | -s|--set-nis-etc) set_etc_nis="yes"; shift;; |
| 27 | -*) echoscip-shell system . . echo. "${0}: ${1}: invalid option" >&2 |
| 28 | USAGE >& 2 |
| 29 | exit 2 ;; |
| 30 | *) break ;; |
| 31 | esac |
| 32 | done |
| 33 | |
| 34 | # isc-dhcp-server |
| 35 | debconf-set-selectionsscip-shell system . . debconf-set-selections. <<EOF |
| 36 | isc-dhcp-server isc-dhcp-server/config_warn note |
| 37 | isc-dhcp-server isc-dhcp-server/interfaces string eth1 |
| 38 | EOF |
| 39 | |
| 40 | # tftpd-hpa |
| 41 | debconf-set-selectionsscip-shell system . . debconf-set-selections. <<EOF |
| 42 | tftpd-hpa tftpd-hpa/username string tftp |
| 43 | tftpd-hpa tftpd-hpa/address string 0.0.0.0:69 |
| 44 | tftpd-hpa tftpd-hpa/options string --secure |
| 45 | tftpd-hpa tftpd-hpa/directory string $pxecfg_pd |
| 46 | EOF |
| 47 | |
| 48 | # nis |
| 49 | debconf-set-selectionsscip-shell system . . debconf-set-selections. <<EOF |
| 50 | nis nis/domain string localdomain |
| 51 | EOF |
| 52 | |
| 53 | # About NIS etc settings |
| 54 | [scip-shell system . . `[`. -f /etc/default/nisscip-shell filesystem . . `/etc/default/nis`. ] && mvscip-shell system . . mv. -f /etc/default/nisscip-shell filesystem . . `/etc/default/nis`. /etc/default/nis.drblsavescip-shell filesystem . . `/etc/default/nis.drblsave`. |
| 55 | if [scip-shell system . . `[`. "$set_etc_nis" = "yes" ]; then |
| 56 | catscip-shell system . . cat. << EOF >> $DEFAULT_NIS |
| 57 | # |
| 58 | # /etc/defaults/nis Configuration settings for the NIS daemons. |
| 59 | # |
| 60 | |
| 61 | # Are we a NIS server and if so what kind (values: false, slave, master) |
| 62 | NISSERVER=false |
| 63 | |
| 64 | # Are we a NIS client (i.e. start ypbind?) |
| 65 | NISCLIENT=false |
| 66 | |
| 67 | # Location of the master NIS password file (for yppasswdd). |
| 68 | # If you change this make sure it matches with /var/yp/Makefile. |
| 69 | YPPWDDIR=/etc |
| 70 | |
| 71 | # Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK |
| 72 | # fields are passed with -e to yppasswdd, see it's manpage. |
| 73 | # Possible values: "chsh", "chfn", "chsh,chfn" |
| 74 | YPCHANGEOK=chsh |
| 75 | |
| 76 | # NIS master server. If this is configured on a slave server then ypinit |
| 77 | # will be run each time NIS is started. |
| 78 | NISMASTER= |
| 79 | |
| 80 | # Additional options to be given to ypserv when it is started. |
| 81 | YPSERVARGS= |
| 82 | |
| 83 | # Additional options to be given to ypbind when it is started. |
| 84 | YPBINDARGS= |
| 85 | |
| 86 | # Additional options to be given to yppasswdd when it is started. Note |
| 87 | # that if -p is set then the YPPWDDIR above should be empty. |
| 88 | YPPASSWDDARGS= |
| 89 | |
| 90 | # Additional options to be given to ypxfrd when it is started. |
| 91 | YPXFRDARGS= |
| 92 | EOF |
| 93 | fi |
| 94 | |
| 95 | echoscip-shell system . . echo. "localdomain" > /etc/defaultdomainscip-shell filesystem . . `/etc/defaultdomain`. |