Changeset 1207


Ignore:
Timestamp:
01/14/12 19:16:04 (4 months ago)
Author:
tschmitt
Message:
  • erste Anpassungen für Ubuntu 11.10.
  • Rembo-Skripte und -Konfigurationsvorlagen entfernt.
Location:
main/linuxmuster-base/branches/testing
Files:
9 added
10 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • main/linuxmuster-base/branches/testing/debian/changelog

    r1206 r1207  
     1linuxmuster-base (6.0.0-0ubuntu0) lenny; urgency=low 
     2 
     3  * initial modifications to be installable on Ubuntu 11.10. 
     4  * removed rembo/myshn scripts and config templates. 
     5 
     6 -- Thomas Schmitt <schmitt@lmz-bw.de>  Sat, 14 Jan 2012 19:14:01 +0100 
     7 
    18linuxmuster-base (5.1.0-3lenny0) lenny; urgency=low 
    29 
  • main/linuxmuster-base/branches/testing/debian/control

    r819 r1207  
    88Package: linuxmuster-base 
    99Architecture: all 
    10 Depends: ${misc:Depends}, dialog, dpkg, dpkg-dev, eject, expect, gcc, pciutils, pwgen, hostname, perl, procmail, ruby, libsysadm-install-perl, libenv-bash-perl, libimap-admin-perl, libpgsql-ruby1.8, libterm-readkey-perl, sed, iptables, samba-common-bin | samba-common 
     10Depends: ${misc:Depends}, dialog, dpkg, dpkg-dev, eject, expect, gcc, pciutils, pwgen, hostname, perl, procmail, libsysadm-install-perl, libenv-bash-perl, libimap-admin-perl, libterm-readkey-perl, sed, iptables, samba-common-bin | samba-common 
    1111Description: paedML Linux configuration scripts 
    1212 This package provides configuration scripts for paedML Linux 
  • main/linuxmuster-base/branches/testing/sbin/import_workstations

    r825 r1207  
    6363RC=0 
    6464 
    65 case "$imaging" in 
     65# backing up workstation data file 
     66echo -n "Backing up $WIMPORTDATA ... " | tee -a $TMPLOG 
     67if backup_file $WIMPORTDATA &> /dev/null; then 
     68 echo "Ok!" | tee -a $TMPLOG 
     69else 
     70 echo "failed!" | tee -a $TMPLOG 
     71fi 
    6672 
    67         linbo) 
    68                 # backing up workstation data file 
    69                 echo -n "Backing up $WIMPORTDATA ... " | tee -a $TMPLOG 
    70                 if backup_file $WIMPORTDATA &> /dev/null; then 
    71                         echo "Ok!" | tee -a $TMPLOG 
    72                 else 
    73                         echo "failed!" | tee -a $TMPLOG 
    74                 fi 
    75  
    76                 echo | tee -a $TMPLOG 
    77                 . $SCRIPTSDIR/wimport.sh | tee -a $TMPLOG 
    78                 RC_ML=${PIPESTATUS[0]} 
    79                 [ $RC_ML -ne 0 ] && RC=$RC_ML 
    80                 ;; 
    81  
    82         rembo) 
    83                 echo -n "Writing Rembo/mySHN configuration ... " 
    84                 if myadmin -i "$REMBOFILES/files/global/wimport_data" --rembo-path "$REMBOFILES" \ 
    85                         --rembo-conf "$REMBOCONF" --myshn-path "$MYSHNDIR" --dhcp-conf "$DHCPDCONF" \ 
    86                         --hostgroup-conf "$HOSTGROUPCONF" --plugin "$SCRIPTSDIR/wimport_lml.rb" 2>> $TMPLOG 1>> $TMPLOG; then 
    87                         echo "Ok!" 
    88                         RC=0 
    89                 else 
    90                         echo "failed!" 
    91                         RC=1 
    92                 fi 
    93  
    94                 echo | tee -a $TMPLOG 
    95                 . $SCRIPTSDIR/wimport.sh | tee -a $TMPLOG 
    96                 RC_ML=${PIPESTATUS[0]} 
    97                 [ $RC_ML -ne 0 ] && RC=$RC_ML 
    98  
    99                 # run this script for the package mlscripts (alternative to myshn) 
    100                 if [ -e "/usr/sbin/mlscripts-wsimport" ] 
    101                 then 
    102                         echo "  * running  /usr/sbin/mlscripts-wsimport" | tee -a $TMPLOG 
    103                         /usr/sbin/mlscripts-wsimport | tee -a $TMPLOG 
    104                         RC_ML=${PIPESTATUS[0]} 
    105                         [ $RC_ML -ne 0 ] && RC=$RC_ML 
    106                 fi 
    107                 ;; 
    108  
    109         *) 
    110                 echo "No imaging system defined! Doing nothing!" | tee -a $TMPLOG 
    111                 RC=1 
    112                 ;; 
    113  
    114 esac 
     73# source import script 
     74echo | tee -a $TMPLOG 
     75. $SCRIPTSDIR/wimport.sh | tee -a $TMPLOG 
     76RC_ML=${PIPESTATUS[0]} 
     77[ $RC_ML -ne 0 ] && RC=$RC_ML 
    11578 
    11679# restart nscd service 
  • main/linuxmuster-base/branches/testing/sbin/linuxmuster-setup

    r1206 r1207  
    112112 
    113113    # check tasks 
    114     for i in common server imaging-linbo; do 
     114    for i in common server; do 
    115115      if [ ! -s "/usr/share/linuxmuster/tasks/$i" ]; then 
    116116        echo "Error: Taskfile $i not found!" | tee -a $logfile 
     
    129129    # tweaking buggy sophomorix, install postgresql first 
    130130    aptitude update | tee -a $logfile 
    131     DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql | tee -a $logfile 
     131    DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql-8.4 | tee -a $logfile 
    132132    #DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql-8.1 | tee -a $logfile 
    133133 
     
    161161 
    162162  --modify) 
     163 
     164    # disabled 
     165    exit 0 
    163166 
    164167    # check for installed flag 
  • main/linuxmuster-base/branches/testing/share/config/dist.conf

    r1206 r1207  
    2020FREECDNAME=$(echo $FREEDISTNAME | awk '{ print $1 }')$(echo $CDVERSION | sed -e 's/\.//g')_i386.iso 
    2121ISOURL=http://lml.support-netz.de/open/iso 
    22  
    23 # rembo/myshn 
    24 REMBODIR="/usr/share/rembo" 
    25 REMBOCONF="/etc/rembo/rembo.conf" 
    26 REMBOSTARTPAGE="cache://global/myshn/bin/start.shtml" 
    27 REMBOFILES="/var/lib/rembo" 
    28 MYSHNDIR="/var/lib/myshn" 
    29 HOSTGROUPCONF="$MYSHNDIR/hostgroup.conf" 
    30 MYSHNCONFIG="$MYSHNDIR/config" 
    3122 
    3223# linuxmuster 
     
    7465SHARELINK="__tauschen" 
    7566STUDENTSLINK="_schueler" 
    76 MYSHNLINK="_myshn" 
    7767# default timeout, 1 second steps 
    7868TIMEOUT=60 
  • main/linuxmuster-base/branches/testing/share/scripts/linuxmuster-patch

    r1206 r1207  
    4444# only in modify mode 
    4545if [ "$1" != "--first" ]; then 
    46  # to be sure imaging packages are installed in case of imaging change 
    47  linuxmuster-task --unattended --install=imaging-$imaging 
    48  
    4946 # reading old values 
    5047 echo "Checking for modified values ..." 
     
    204201fi 
    205202 
     203# check if sophomorix is installed 
     204SOPHOMORIX="$(dpkg -l sophomorix2 | grep -q ^i)" 
    206205 
    207206# patching conffiles 
     
    257256              s/@@adminmac@@/${mac_intern}/g 
    258257              s/@@sambasid@@/${sambasid}/g 
     258              s/@@pgmadmin@@/${PGMADMIN}/g 
    259259              s/@@domadmin@@/${DOMADMIN}/g 
    260260              s/@@domadmins@@/${DOMADMINS}/g 
  • main/linuxmuster-base/branches/testing/share/tasks/desktop

    r787 r1207  
    1 kdebase 
    2 kdeadmin 
    3 kdenetwork 
    4 kdeutils 
    5 kdeaddons 
    6 kdm 
    7 kde-i18n-de 
    8 iceweasel 
    9 iceweasel-l10n-de 
    10 x-window-system 
     1lubuntu-desktop 
     2xserver-xorg 
  • main/linuxmuster-base/branches/testing/share/tasks/server

    r1206 r1207  
    55aspell-de 
    66bind9 
    7 cdrecord 
    87chkrootkit 
    98clamav-daemon 
     
    1716cyrus-pop3d-2.2 
    1817dhcp3-server 
    19 firmware-linux-free 
    20 firmware-linux-nonfree 
    2118foomatic-filters-ppds 
    2219gollem 
     
    2623ingo1 
    2724kronolith2 
     25language-pack-de 
     26language-pack-de-base 
    2827ldap-utils 
    2928lha 
     
    3332libpam-ldap 
    3433libsasl2-modules 
    35 linux-headers-2.6-686-bigmem 
    36 linux-image-686-bigmem 
    37 linuxmuster-ipcop 
     34linux-headers-server 
     35linux-image-server 
     36linux-firmware 
     37linux-firmware-nonfree 
     38linuxmuster-linbo 
    3839linuxmuster-nagios-base 
    3940linuxmuster-schulkonsole 
     
    4243mnemo2 
    4344mondo 
    44 moodle 
    4545mysql-server 
    4646nag2 
     
    7777portmap 
    7878postfix 
    79 postgresql-8.3 
    80 postgresql-client-8.3 
     79postgresql-8.4 
    8180rar 
    8281razor 
     
    8685slapd 
    8786sophomorix2 
     87tftpd-hpa 
    8888turba2 
    8989unace 
     
    9191unzip 
    9292uucp 
    93 webmin 
    9493zip 
    9594zoo 
  • main/linuxmuster-base/branches/testing/var/config-dynamic/15_ldap/postpatch

    r1031 r1207  
    11# $Id$ 
    2  
    3 # remove smb.conf template again 
    4 [ -e smb.conf ] && rm smb.conf 
    5  
    62 
    73# set samba sid 
     
    3026 
    3127 
    32 # patching sophomorix.conf with schoolname, location and year 
    33 [ "$1" = "--modify" ] && backup_file $SOPHOMORIXCONF 
    34 yearnow="$(date +%Y)" 
    35 sed -e "s/^\$schul_name=.*/\$schul_name=\"${schoolname} ${location}\";/ 
    36         s/^\$geburts_jahreszahl_stop=.*/\$geburts_jahreszahl_stop=$yearnow;/" -i $SOPHOMORIXCONF 
     28# check if sophomorix is installed 
     29if [ -n "$SOPHOMORIX" ]; then 
     30 
     31 # patching sophomorix.conf with schoolname, location and year 
     32 [ "$1" = "--modify" ] && backup_file $SOPHOMORIXCONF 
     33 yearnow="$(date +%Y)" 
     34 sed -e "s/^\$schul_name=.*/\$schul_name=\"${schoolname} ${location}\";/ 
     35         s/^\$geburts_jahreszahl_stop=.*/\$geburts_jahreszahl_stop=$yearnow;/" -i $SOPHOMORIXCONF 
    3736 
    3837 
    39 # patch sophomorix pgldap.conf with workgroup, server, internip and domainname 
    40 template=/etc/sophomorix/pgldap/pgldap.conf 
    41 [ "$1" = "--modify" ] && backup_file $template 
    42 sed -e "s/^\$domainname=.*/\$domainname=\"${domainname}\";/ 
    43         s/^\$servername=.*/\$servername=\"${servername}\";/ 
    44         s/^\$internip=.*/\$internip=\"${serverip}\";/ 
    45         s/^\$internmask=.*/\$internmask=\"${internmask}\";/ 
    46         s/^\$smbworkgroup=.*/\$smbworkgroup=\"${workgroup}\";/" -i $template 
     38 # patch sophomorix pgldap.conf with workgroup, server, internip and domainname 
     39 template=/etc/sophomorix/pgldap/pgldap.conf 
     40 [ "$1" = "--modify" ] && backup_file $template 
     41 sed -e "s/^\$domainname=.*/\$domainname=\"${domainname}\";/ 
     42         s/^\$servername=.*/\$servername=\"${servername}\";/ 
     43         s/^\$internip=.*/\$internip=\"${serverip}\";/ 
     44         s/^\$internmask=.*/\$internmask=\"${internmask}\";/ 
     45         s/^\$smbworkgroup=.*/\$smbworkgroup=\"${workgroup}\";/" -i $template 
    4746 
    4847 
    49 # patch sophomorix ldif template 
    50 template1=/usr/share/sophomorix/config-templates/ldap/standalone.ldif.template 
    51 template2=/usr/share/sophomorix/config-templates/ldap/local-gen.ldif 
    52 dc="$(echo $domainname | awk -F\. '{ print $1 }')" 
    53 [ "$1" = "--modify" ] && backup_file $template2 
    54 sed -e "s|@@basedn@@|$basedn|g 
    55         s|@@workgroup@@|$workgroup|g 
    56         s|sambaDomainName:.*|sambaDomainName: $workgroup| 
    57         s|@@sid@@|$sambasid| 
    58         s|@@dc@@|$dc|" $template1 > $template2 
     48 # patch sophomorix ldif template 
     49 template1=/usr/share/sophomorix/config-templates/ldap/standalone.ldif.template 
     50 template2=/usr/share/sophomorix/config-templates/ldap/local-gen.ldif 
     51 dc="$(echo $domainname | awk -F\. '{ print $1 }')" 
     52 [ "$1" = "--modify" ] && backup_file $template2 
     53 sed -e "s|@@basedn@@|$basedn|g 
     54         s|@@workgroup@@|$workgroup|g 
     55         s|sambaDomainName:.*|sambaDomainName: $workgroup| 
     56         s|@@sid@@|$sambasid| 
     57         s|@@dc@@|$dc|" $template1 > $template2 
     58 
     59fi # installed 
     60 
    5961# only on fresh install 
    6062if [ "$1" = "--first" ]; then 
     
    7577        rm -rf /var/log/sophomorix/user/* 
    7678 
    77         # changing user's default shell to /bin/bash 
    78         sed -e 's/^\$schueler_per_ssh=.*/\$schueler_per_ssh=\"yes\"\;/ 
    79                 s/^\$lehrer_per_ssh=.*/\$lehrer_per_ssh=\"yes\"\;/' -i $SOPHOMORIXCONF 
    80  
    8179        # openldap access to ssl-certs 
    8280        addgroup openldap ssl-cert 
     
    8583        createuser -U postgres -S -D -R ldap 
    8684        createdb -U postgres -O ldap ldap 
    87         sed -e "s|@@workgroup@@|${workgroup}|g 
    88                 s|@@sambasid@@|${sambasid}|g 
    89                 s|@@basedn@@|${basedn}|g" ldap.pgsql | psql -U postgres ldap 
    90         [ -e /etc/ldap/slapd.d ] && rm -rf /etc/ldap/slapd.d 
    91         mkdir -p /etc/ldap/slapd.d 
    92         slaptest -u -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d 
    93         chown openldap:openldap /etc/ldap/slapd.d -R 
     85        psql -U postgres ldap < /var/tmp/ldap.pgsql 
     86 
     87        # create new ldap tree 
     88        rm -rf /etc/ldap/slapd.d 
     89        mkdir -p /etc/ldap/slapd.d 
     90        chattr +i /var/lib/ldap/DB_CONFIG 
     91        rm -f /var/lib/ldap/* 
     92        chattr -i /var/lib/ldap/DB_CONFIG 
     93        slapadd < /var/tmp/ldap.ldif 
     94        chown openldap:openldap /var/lib/ldap -R 
     95        slaptest -f /etc/ldap/slapd.conf -F /etc/ldap/slapd.d 
     96        chown -R openldap:openldap /etc/ldap/slapd.d 
     97 
     98        # changing user's default shell to /bin/bash 
     99        [ -n "$SOPHOMORIX" ] && sed -e 's/^\$schueler_per_ssh=.*/\$schueler_per_ssh=\"yes\"\;/ 
     100                                        s/^\$lehrer_per_ssh=.*/\$lehrer_per_ssh=\"yes\"\;/' -i $SOPHOMORIXCONF 
    94101 
    95102        # new random password for ldap db user 
     
    145152# repair permissions 
    146153for i in /etc/ldap.secret /etc/smbldap-tools/smbldap_bind.conf /etc/sophomorix/pgldap/pgldap.conf; do 
     154  [ -e "$i" ] || continue 
    147155  chown root:root $i 
    148156  chmod 600 $i 
     
    162170 
    163171# recreate ldap tree 
    164 sophomorix-dump-pg2ldap 
     172# sophomorix-dump-pg2ldap 
    165173 
     174rm -f /var/tmp/ldap.* 
    166175 
    167176# start services again 
    168177/etc/init.d/nscd stop 
    169 /etc/init.d/samba stop 
     178/etc/init.d/smbd stop 
    170179/etc/init.d/slapd stop 
    171180/etc/init.d/slapd start 
    172 /etc/init.d/samba start 
     181/etc/init.d/smbd start 
    173182/etc/init.d/nscd start 
    174183 
    175184 
    176185# finally create homes on first install 
    177 if [ "$1" = "--first" ]; then 
     186if [ "$1" = "--first" -a -n "$SOPHOMORIX" ]; then 
    178187 sophomorix-repair --permissions 
    179188 sophomorix-repair --repairhome 
  • main/linuxmuster-base/branches/testing/var/config-dynamic/15_ldap/prepatch

    r787 r1207  
    1 # necessary to trick sophomorix 
     1# $Id$ 
     2 
    23if [ "$1" = "--first" ]; then 
    3         pg_dropcluster 8.3 main &> /dev/null 
    4         pg_createcluster 8.3 main 
    5         cp $STATICTPLDIR/etc/postgresql/8.3/main/* /etc/postgresql/8.3/main 
     4 
     5 # necessary to trick sophomorix 
     6 pg_dropcluster 8.4 main &> /dev/null 
     7 pg_createcluster 8.4 main 
     8 cp $STATICTPLDIR/etc/postgresql/8.4/main/* /etc/postgresql/8.4/main 
     9 
     10else 
     11 
     12 # don't patch database templates 
     13 for i in ldap.ldif ldap.pgsql; do 
     14  mv $i.target $i.target.nopatch 
     15 done 
     16 
    617fi 
    7 /etc/init.d/postgresql-8.3 start 
    818 
     19/etc/init.d/postgresql-8.4 start 
    920 
    1021# clear samba browse cache 
    1122rm -f /var/lib/samba/wins.dat 
    1223 
    13  
    14 # copy imaging related template 
    15 cp smb.conf.$imaging smb.conf 
    16  
  • main/linuxmuster-base/branches/testing/var/config-dynamic/17_admins/prepatch

    r787 r1207  
    1515 
    1616  # set passwords for admins 
    17   sophomorix-passwd --force --user $DOMADMIN --pass $adminpw 
    18   sophomorix-passwd --user $ADMINISTRATOR --pass $adminpw 
    19   sophomorix-passwd --user $PGMADMIN --pass $pgmadminpw 
    20   sophomorix-passwd --user $WWWADMIN --pass $wwwadminpw 
    21   sophomorix-usermod -I wwwadmin 
     17  if [ -n "$SOPHOMORIX" ]; then 
     18   sophomorix-passwd --force --user $DOMADMIN --pass $adminpw 
     19   sophomorix-passwd --user $ADMINISTRATOR --pass $adminpw 
     20   sophomorix-passwd --user $PGMADMIN --pass $pgmadminpw 
     21   sophomorix-passwd --user $WWWADMIN --pass $wwwadminpw 
     22   sophomorix-usermod -I wwwadmin 
     23  else 
     24   echo -e "$adminpw\n$adminpw\n" | smbldap-passwd -s $DOMADMIN 
     25   echo -e "$adminpw\n$adminpw\n" | smbldap-passwd -s $ADMINISTRATOR 
     26   echo -e "$pgmadminpw\n$pgmadminpw\n" | smbldap-passwd -s $PGMADMIN 
     27   echo -e "$wwwadminpw\n$wwwadminpw\n" | smbldap-passwd -s $WWWADMIN 
     28   smbldap-usermod -I $WWWADMIN 
     29  fi 
    2230 
    2331  # create mailboxes again 
  • main/linuxmuster-base/branches/testing/var/config-dynamic/20_moodle/postpatch

    • Property svn:keywords changed from Id to Id Revision
    r787 r1207  
    1 if [ "$1" = "--first" ]; then 
     1# $Id$ 
     2 
     3# check if moodle is installed 
     4if dpkg -l | grep moodle | grep -q ^i; then 
     5 
     6 if [ "$1" = "--first" ]; then 
    27 
    38  # create tables 
     
    712  rm -f /var/tmp/moodle.psql 
    813 
    9 fi 
     14 fi 
    1015 
    11 # secure permissions of config.php 
    12 chown root:www-data /etc/moodle/config.php 
    13 chmod 440 /etc/moodle/config.php 
     16 # secure permissions of config.php 
     17 chown root:www-data /etc/moodle/config.php 
     18 chmod 440 /etc/moodle/config.php 
    1419 
    1520# check config.php link 
    16 if [ ! -L /usr/share/moodle/config.php ]; then 
     21 if [ ! -L /usr/share/moodle/config.php ]; then 
    1722  [ -e /usr/share/moodle/config.php ] && rm -rf /usr/share/moodle/config.php 
    1823  ln -s /etc/moodle/config.php /usr/share/moodle/config.php 
    19 fi 
     24 fi 
    2025 
     26fi # installed 
     27 
  • main/linuxmuster-base/branches/testing/var/config-dynamic/20_moodle/prepatch

    • Property svn:keywords changed from Id to Id Revision
    r787 r1207  
    1 # do this only if moodle is installed 
    2 if dpkg -L moodle &> /dev/null; then 
     1# $Id$ 
     2 
     3# check if moodle is installed 
     4if dpkg -l | grep moodle | grep -q ^i; then 
    35 
    46  if [ "$1" = "--first" ]; then 
  • main/linuxmuster-base/branches/testing/var/config-dynamic/40_linbo/prepatch

    r1206 r1207  
    11# $Id$ 
    22# 
    3 # check if imaging method is linbo  
    43 
    5 if  [ "$imaging" = "linbo" ]; then 
     4# create tftpd-hpa configs if necessary 
     5tpldir="/usr/share/linuxmuster-linbo/templates" 
     6tpl="$tpldir/tftpd-hpa.default" 
     7conf="/etc/default/tftpd-hpa" 
     8if ! grep -q "$LINBODIR" "$conf"; then 
     9 echo "Patching $conf." 
     10 backup_file "$conf" 
     11 sed -e "s|@@linbodir@@|$LINBODIR|" "$tpl" > "$conf" 
     12fi 
     13conf="/etc/tftp_remap.conf" 
     14tpl="$tpldir/$(basename $conf)" 
     15if [ ! -e "$conf" ]; then 
     16 echo "Providing $conf." 
     17 cp "$tpl" "$conf" 
     18fi 
    619 
    7  # create tftpd-hpa configs if necessary 
    8  tpldir="/usr/share/linuxmuster-linbo/templates" 
    9  tpl="$tpldir/tftpd-hpa.default" 
    10  conf="/etc/default/tftpd-hpa" 
    11  if ! grep -q "$LINBODIR" "$conf"; then 
    12   echo "Patching $conf." 
    13   backup_file "$conf" 
    14   sed -e "s|@@linbodir@@|$LINBODIR|" "$tpl" > "$conf" 
     20# check for tftp in inetd.conf 
     21conf=/etc/inetd.conf 
     22if grep -q ^tftp "$conf"; then 
     23 echo "Deactivating tftp in $conf." 
     24 backup_file "$conf" 
     25 sed -e 's|^tftp|#tftp|' -i "$conf" 
     26fi 
     27 
     28# stuff to do on first time install 
     29if [ "$1" = "--first" ]; then 
     30 
     31 # patch rsyncd.secrets with admin password 
     32 [ -e /etc/rsyncd.secrets ] && backup_file /etc/rsyncd.secrets 
     33 if grep ^linbo: /etc/rsyncd.secrets &> /dev/null; then 
     34  sed -e "s/^linbo:.*/linbo:$adminpw/" -i /etc/rsyncd.secrets 
     35 else 
     36  echo "linbo:$adminpw" >> /etc/rsyncd.secrets 
    1537 fi 
    16  conf="/etc/tftp_remap.conf" 
    17  tpl="$tpldir/$(basename $conf)" 
    18  if [ ! -e "$conf" ]; then 
    19   echo "Providing $conf." 
    20   cp "$tpl" "$conf" 
    21  fi 
     38  # provide empty workstations data 
     39 rm -rf $SYSCONFDIR/workstations 
    2240 
    23  # check for tftp in inetd.conf 
    24  conf=/etc/inetd.conf 
    25  if grep -q ^tftp "$conf"; then 
    26   echo "Deactivating tftp in $conf." 
    27   backup_file "$conf" 
    28   sed -e 's|^tftp|#tftp|' -i "$conf" 
    29  fi 
     41else # modify 
    3042 
    31  # stuff to do on first time install 
    32  if [ "$1" = "--first" ]; then 
    33  
    34   # patch rsyncd.secrets with admin password 
    35   [ -e /etc/rsyncd.secrets ] && backup_file /etc/rsyncd.secrets 
    36   if grep ^linbo: /etc/rsyncd.secrets &> /dev/null; then 
    37    sed -e "s/^linbo:.*/linbo:$adminpw/" -i /etc/rsyncd.secrets 
     43 # restore workstations file from link if coming from rembo 
     44 if [ "$imaging_old" = "rembo" ]; then 
     45  if [ -L "$SYSCONFDIR/workstations" ]; then 
     46   rm $SYSCONFDIR/workstations 
    3847  else 
    39    echo "linbo:$adminpw" >> /etc/rsyncd.secrets 
     48   backup_file $SYSCONFDIR/workstations 
    4049  fi 
    41  
    42   # provide empty workstations data 
    43   rm -rf $SYSCONFDIR/workstations 
    44  
    45  else # modify 
    46  
    47   # restore workstations file from link if coming from rembo 
    48   if [ "$imaging_old" = "rembo" ]; then 
    49    if [ -L "$SYSCONFDIR/workstations" ]; then 
    50     rm $SYSCONFDIR/workstations 
    51    else 
    52     backup_file $SYSCONFDIR/workstations 
    53    fi 
    54    cp $REMBOFILES/files/global/wimport_data $SYSCONFDIR/workstations 
    55   fi 
    56  
    57  fi 
    58  
    59  touch $SYSCONFDIR/workstations 
    60  
    61  # patch path to wimport_data in dist.conf 
    62  backup_file /usr/share/linuxmuster/config/dist.conf 
    63  sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$SYSCONFDIR\/workstations\"/" -i /usr/share/linuxmuster/config/dist.conf 
    64  
    65  # if no linbo password then grep rsync password from rembo.conf or if that fails take simply muster as password 
    66  if ! grep ^linbo: /etc/rsyncd.secrets &> /dev/null; then 
    67   linbopw=`grep ^NetPassword /etc/rembo/rembo.conf | awk -F\" '{ print $2 }'` 
    68   [ -z "$linbopw" ] && linbopw=muster 
    69   echo "linbo:$linbopw" >> /etc/rsyncd.secrets 
    70  fi 
    71  chmod 600 /etc/rsyncd.secrets 
    72  
    73  # check for initial rsync configuration and copy it if necessary 
    74  teststr="# automatically created by linuxmuster-setup" 
    75  grep "$teststr" /etc/rsyncd.conf &> /dev/null || cp $STATICTPLDIR/etc/rsyncd.conf /etc 
    76  
    77  # link pxelinux.0 to linbo dir 
    78  [ -e "$LINBODIR/pxelinux.0" ] || ln -sf /usr/lib/syslinux/pxelinux.0 $LINBODIR/pxelinux.0 
    79  
    80  # open internal firewall for multicasting and rsync 
    81  . /etc/default/linuxmuster-linbo 
    82  if ! grep ^udp $ALLOWEDPORTS | grep -q $PORTBASE:; then 
    83   backup_file $ALLOWEDPORTS 
    84   PORTMAX=$PORTBASE 
    85   let PORTMAX+=100 
    86   PORTS=`grep ^udp $ALLOWEDPORTS | awk '{ print $2 }'` 
    87   PORTS="$PORTS,$PORTBASE:$PORTMAX" 
    88   sed -e "s/^udp.*/udp $PORTS/" -i $ALLOWEDPORTS 
    89  fi 
    90  if ! grep ^tcp $BASEPORTS | grep -qw rsync; then 
    91   backup_file $BASEPORTS 
    92   PORTS=`grep ^tcp $BASEPORTS | awk '{ print $2 }'` 
    93   PORTS="$PORTS,rsync" 
    94   sed -e "s/^tcp.*/tcp $PORTS/" -i $BASEPORTS 
    95  fi 
    96  
    97  # patch start.confs with serverip 
    98  for i in $LINBODEFAULTCONF `find $LINBODIR/ -type f -name 'start.conf*'`; do 
    99   backup_file $i 
    100   sed -e "s/^Server = \([0-9]\{1,3\}[.]\)\{3\}[0-9]\{1,3\}/Server = $serverip/" -i $i 
    101  done 
    102  
    103  # patch regs with workgroup 
    104  for i in `find $LINBODIR/ -type f -name '*.reg'`; do 
    105   backup_file $i 
    106   sed -e "s/^\"DefaultDomainName\"=.*/\"DefaultDomainName\"=\"$workgroup\"/ 
    107           s/^\"Workgroup\"=.*/\"Workgroup\"=\"$workgroup\"/" -i $i 
    108  done 
    109  
    110  # patch start variables of tftpd-hpa and rsync 
    111  sed -e "s/^RUN_DAEMON=.*/RUN_DAEMON=yes/" -i /etc/default/tftpd-hpa 
    112  sed -e "s/^RSYNC_ENABLE=.*/RSYNC_ENABLE=true/" -i /etc/default/rsync 
    113  
    114  # check for images and start multicast 
    115  update-rc.d linbo-multicast defaults 
    116  res=`find $LINBODIR -name '*.cloop'` 
    117  if [ -n "$res" ]; then 
    118   sed -e "s/^START_MULTICAST=.*/START_MULTICAST=yes/" -i /etc/default/linuxmuster-linbo 
    119   /etc/init.d/linbo-multicast start 
    120  else 
    121   sed -e "s/^START_MULTICAST=.*/START_MULTICAST=no/" -i /etc/default/linuxmuster-linbo 
    122  fi 
    123  
    124  # linbo administrative user 
    125  if ! check_id linbo; then 
    126   linbopasswd=`grep ^linbo /etc/rsyncd.secrets | awk -F\: '{ print $2 }'` 
    127   if [ -n "$linbopasswd" ]; then 
    128    echo "Creating linbo user ..." 
    129    sophomorix-useradd --administrator linbo --unix-group $ADMINGROUP --shell /bin/false --gecos "LINBO Administrator" &> /dev/null || true 
    130    sophomorix-passwd --user linbo --pass $linbopasswd &> /dev/null || true 
    131    smbldap-usermod -H '[UX         ]' linbo || true 
    132   fi 
    133  fi 
    134  
    135  # check for linbo mail wrapper in /etc/aliases 
    136  if ! grep -q ^linbo: /etc/aliases; then 
    137   backup_file /etc/aliases 
    138   sed -e "/^root:/a\ 
    139 linbo: \"\|\/usr\/share\/linuxmuster-linbo\/mail2log.sh\"" -i /etc/aliases 
    140   newaliases 
    141  fi 
    142  
    143  # change owner of logdir to nobody 
    144  [ -d "$LOGDIR/linbo" ] || mkdir -p $LOGDIR/linbo 
    145  chown nobody $LOGDIR/linbo 
    146  
    147  # start necessary services 
    148  /etc/init.d/tftpd-hpa start 
    149  /etc/init.d/rsync start 
    150         # don't start these on first install 
    151         if [ "$1" != "--first" ]; then 
    152          /etc/init.d/bittorrent start 
    153          /etc/init.d/linbo-bittorrent start 
    154          /etc/init.d/linbo-multicast start 
    155         else 
    156          [ -e /etc/default/bittorrent ] && sed -e 's|^START_BTTRACK=.*|START_BTTRACK=0|' -i /etc/default/bittorrent 
    157          [ -e /etc/default/linbo-bittorrent ] && sed -e 's|^START_BITTORRENT=.*|START_BITTORRENT=0|' -i /etc/default/linbo-bittorrent 
    158          [ -e /etc/default/linuxmuster-linbo ] && sed -e 's|^START_MULTICAST=.*|START_MULTICAST=no|' -i /etc/default/linuxmuster-linbo 
    159         fi 
    160  
    161  # don't start these on first install 
    162  if [ "$1" != "--first" ]; then 
    163   /etc/init.d/bittorrent start 
    164   /etc/init.d/linbo-bittorrent start 
    165   /etc/init.d/linbo-multicast start 
    166  else 
    167   [ -e /etc/default/bittorrent ] && sed -e 's|^START_BTTRACK=.*|START_BTTRACK=0|' -i /etc/default/bittorrent 
    168   [ -e /etc/default/linbo-bittorrent ] && sed -e 's|^START_BITTORRENT=.*|START_BITTORRENT=0|' -i /etc/default/linbo-bittorrent 
    169   [ -e /etc/default/linuxmuster-linbo ] && sed -e 's|^START_MULTICAST=.*|START_MULTICAST=no|' -i /etc/default/linuxmuster-linbo 
    170  fi 
    171  
    172 else # switch to rembo, deactivate linbo 
    173  
    174  # patch start variables of tftpd-hpa and rsync 
    175  [ -e /etc/default/tftpd-hpa ] && backup_file /etc/default/tftpd-hpa ; sed -e "s/^RUN_DAEMON=.*/RUN_DAEMON=no/" -i /etc/default/tftpd-hpa 
    176  [ -e /etc/default/rsync ] && backup_file /etc/default/rsync ; sed -e "s/^RSYNC_ENABLE=.*/RSYNC_ENABLE=false/" -i /etc/default/rsync 
    177  [ -e /etc/default/linuxmuster-linbo ] && backup_file /etc/default/linuxmuster-linbo ; sed -e "s/^START_MULTICAST=.*/START_MULTICAST=no/" -i /etc/default/linuxmuster-linbo 
    178  
    179  # remove linbo mail wrapper from /etc/aliases 
    180  if grep -q ^linbo: /etc/aliases; then 
    181   backup_file /etc/aliases 
    182   grep -v ^linbo: /etc/aliases > /var/tmp/aliases 
    183   mv /var/tmp/aliases /etc/aliases 
    184   newaliases 
     50  cp $REMBOFILES/files/global/wimport_data $SYSCONFDIR/workstations 
    18551 fi 
    18652 
    18753fi 
    18854 
     55touch $SYSCONFDIR/workstations 
     56 
     57# patch path to wimport_data in dist.conf 
     58backup_file /usr/share/linuxmuster/config/dist.conf 
     59sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$SYSCONFDIR\/workstations\"/" -i /usr/share/linuxmuster/config/dist.conf 
     60 
     61# if no linbo password then grep rsync password from rembo.conf or if that fails take simply muster as password 
     62if ! grep ^linbo: /etc/rsyncd.secrets &> /dev/null; then 
     63 linbopw=`grep ^NetPassword /etc/rembo/rembo.conf | awk -F\" '{ print $2 }'` 
     64 [ -z "$linbopw" ] && linbopw=muster 
     65 echo "linbo:$linbopw" >> /etc/rsyncd.secrets 
     66fi 
     67chmod 600 /etc/rsyncd.secrets 
     68 
     69# check for initial rsync configuration and copy it if necessary 
     70teststr="# automatically created by linuxmuster-setup" 
     71grep "$teststr" /etc/rsyncd.conf &> /dev/null || cp $STATICTPLDIR/etc/rsyncd.conf /etc 
     72 
     73# link pxelinux.0 to linbo dir 
     74[ -e "$LINBODIR/pxelinux.0" ] || ln -sf /usr/lib/syslinux/pxelinux.0 $LINBODIR/pxelinux.0 
     75 
     76# open internal firewall for multicasting and rsync 
     77. /etc/default/linuxmuster-linbo 
     78if ! grep ^udp $ALLOWEDPORTS | grep -q $PORTBASE:; then 
     79 backup_file $ALLOWEDPORTS 
     80 PORTMAX=$PORTBASE 
     81 let PORTMAX+=100 
     82 PORTS=`grep ^udp $ALLOWEDPORTS | awk '{ print $2 }'` 
     83 PORTS="$PORTS,$PORTBASE:$PORTMAX" 
     84 sed -e "s/^udp.*/udp $PORTS/" -i $ALLOWEDPORTS 
     85fi 
     86if ! grep ^tcp $BASEPORTS | grep -qw rsync; then 
     87 backup_file $BASEPORTS 
     88 PORTS=`grep ^tcp $BASEPORTS | awk '{ print $2 }'` 
     89 PORTS="$PORTS,rsync" 
     90 sed -e "s/^tcp.*/tcp $PORTS/" -i $BASEPORTS 
     91fi 
     92 
     93# patch start.confs with serverip 
     94for i in $LINBODEFAULTCONF `find $LINBODIR/ -type f -name 'start.conf*'`; do 
     95 backup_file $i 
     96 sed -e "s/^Server = \([0-9]\{1,3\}[.]\)\{3\}[0-9]\{1,3\}/Server = $serverip/" -i $i 
     97done 
     98 
     99# patch regs with workgroup 
     100for i in `find $LINBODIR/ -type f -name '*.reg'`; do 
     101 backup_file $i 
     102 sed -e "s/^\"DefaultDomainName\"=.*/\"DefaultDomainName\"=\"$workgroup\"/ 
     103         s/^\"Workgroup\"=.*/\"Workgroup\"=\"$workgroup\"/" -i $i 
     104done 
     105 
     106# patch start variables of tftpd-hpa and rsync 
     107sed -e "s/^RUN_DAEMON=.*/RUN_DAEMON=yes/" -i /etc/default/tftpd-hpa 
     108sed -e "s/^RSYNC_ENABLE=.*/RSYNC_ENABLE=true/" -i /etc/default/rsync 
     109 
     110# check for images and start multicast 
     111update-rc.d linbo-multicast defaults 
     112res=`find $LINBODIR -name '*.cloop'` 
     113if [ -n "$res" ]; then 
     114 sed -e "s/^START_MULTICAST=.*/START_MULTICAST=yes/" -i /etc/default/linuxmuster-linbo 
     115 /etc/init.d/linbo-multicast start 
     116else 
     117 sed -e "s/^START_MULTICAST=.*/START_MULTICAST=no/" -i /etc/default/linuxmuster-linbo 
     118fi 
     119 
     120# linbo administrative user 
     121if ! check_id linbo; then 
     122 linbopasswd=`grep ^linbo /etc/rsyncd.secrets | awk -F\: '{ print $2 }'` 
     123 if [ -n "$linbopasswd" ]; then 
     124  echo "Creating linbo user ..." 
     125  if [ -n "$SOPHOMORIX" ]; then 
     126   sophomorix-useradd --administrator linbo --unix-group $ADMINGROUP --shell /bin/false --gecos "LINBO Administrator" &> /dev/null || true 
     127   sophomorix-passwd --user linbo --pass $linbopasswd &> /dev/null || true 
     128  else 
     129   smbldap-useradd -a -c "LINBO Administrator" -N LINBO -S Administrator -s /bin/false -g $ADMINGROUP -d $ADMINSHOME/linbo -m linbo 
     130   echo -e "$linbopasswd\n$linbopasswd\n" | smbldap-passwd -s linbo 
     131  fi 
     132  smbldap-usermod -H '[UX         ]' linbo || true 
     133 fi 
     134fi 
     135 
     136# check for linbo mail wrapper in /etc/aliases 
     137if ! grep -q ^linbo: /etc/aliases; then 
     138 backup_file /etc/aliases 
     139 sed -e "/^root:/a\ 
     140linbo: \"\|\/usr\/share\/linuxmuster-linbo\/mail2log.sh\"" -i /etc/aliases 
     141 newaliases 
     142fi 
     143 
     144# change owner of logdir to nobody 
     145[ -d "$LOGDIR/linbo" ] || mkdir -p $LOGDIR/linbo 
     146chown nobody $LOGDIR/linbo 
     147 
     148# start necessary services 
     149/etc/init.d/tftpd-hpa start 
     150/etc/init.d/rsync start 
     151 
     152# don't start these on first install 
     153if [ "$1" != "--first" ]; then 
     154 /etc/init.d/bittorrent start 
     155 /etc/init.d/linbo-bittorrent start 
     156 /etc/init.d/linbo-multicast start 
     157else 
     158 [ -e /etc/default/bittorrent ] && sed -e 's|^START_BTTRACK=.*|START_BTTRACK=0|' -i /etc/default/bittorrent 
     159 [ -e /etc/default/linbo-bittorrent ] && sed -e 's|^START_BITTORRENT=.*|START_BITTORRENT=0|' -i /etc/default/linbo-bittorrent 
     160 [ -e /etc/default/linuxmuster-linbo ] && sed -e 's|^START_MULTICAST=.*|START_MULTICAST=no|' -i /etc/default/linuxmuster-linbo 
     161fi 
     162 
Note: See TracChangeset for help on using the changeset viewer.