Changeset 1207
- Timestamp:
- 01/14/12 19:16:04 (4 months ago)
- Location:
- main/linuxmuster-base/branches/testing
- Files:
-
- 9 added
- 10 deleted
- 14 edited
-
debian/changelog (modified) (1 diff)
-
debian/control (modified) (1 diff)
-
sbin/import_workstations (modified) (1 diff)
-
sbin/linuxmuster-setup (modified) (3 diffs)
-
share/config/dist.conf (modified) (2 diffs)
-
share/scripts/helper.rb (deleted)
-
share/scripts/linuxmuster-patch (modified) (3 diffs)
-
share/scripts/wimport_lml.rb (deleted)
-
share/tasks/desktop (modified) (1 diff)
-
share/tasks/imaging-linbo (deleted)
-
share/tasks/imaging-rembo (deleted)
-
share/tasks/server (modified) (8 diffs)
-
share/upgrade (deleted)
-
var/config-dynamic/15_ldap/ldap.ldif (added)
-
var/config-dynamic/15_ldap/ldap.ldif.target (added)
-
var/config-dynamic/15_ldap/ldap.pgsql.target (added)
-
var/config-dynamic/15_ldap/postpatch (modified) (6 diffs)
-
var/config-dynamic/15_ldap/prepatch (modified) (1 diff)
-
var/config-dynamic/15_ldap/smb.conf (added)
-
var/config-dynamic/15_ldap/smb.conf.linbo (deleted)
-
var/config-dynamic/15_ldap/smb.conf.rembo (deleted)
-
var/config-dynamic/17_admins/prepatch (modified) (1 diff)
-
var/config-dynamic/20_moodle/postpatch (modified) (2 diffs, 1 prop)
-
var/config-dynamic/20_moodle/prepatch (modified) (1 diff, 1 prop)
-
var/config-dynamic/40_linbo/prepatch (modified) (1 diff)
-
var/config-dynamic/45_rembo (deleted)
-
var/config-static/etc/postgresql/8.3 (deleted)
-
var/config-static/etc/postgresql/8.4 (added)
-
var/config-static/etc/postgresql/8.4/main (added)
-
var/config-static/etc/postgresql/8.4/main/pg_hba.conf (added)
-
var/config-static/etc/postgresql/8.4/main/pg_ident.conf (added)
-
var/config-static/etc/postgresql/8.4/main/postgresql.conf (added)
-
var/config-static/etc/rembo (deleted)
Legend:
- Unmodified
- Added
- Removed
-
main/linuxmuster-base/branches/testing/debian/changelog
r1206 r1207 1 linuxmuster-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 1 8 linuxmuster-base (5.1.0-3lenny0) lenny; urgency=low 2 9 -
main/linuxmuster-base/branches/testing/debian/control
r819 r1207 8 8 Package: linuxmuster-base 9 9 Architecture: 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-common10 Depends: ${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 11 11 Description: paedML Linux configuration scripts 12 12 This package provides configuration scripts for paedML Linux -
main/linuxmuster-base/branches/testing/sbin/import_workstations
r825 r1207 63 63 RC=0 64 64 65 case "$imaging" in 65 # backing up workstation data file 66 echo -n "Backing up $WIMPORTDATA ... " | tee -a $TMPLOG 67 if backup_file $WIMPORTDATA &> /dev/null; then 68 echo "Ok!" | tee -a $TMPLOG 69 else 70 echo "failed!" | tee -a $TMPLOG 71 fi 66 72 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 74 echo | tee -a $TMPLOG 75 . $SCRIPTSDIR/wimport.sh | tee -a $TMPLOG 76 RC_ML=${PIPESTATUS[0]} 77 [ $RC_ML -ne 0 ] && RC=$RC_ML 115 78 116 79 # restart nscd service -
main/linuxmuster-base/branches/testing/sbin/linuxmuster-setup
r1206 r1207 112 112 113 113 # check tasks 114 for i in common server imaging-linbo; do114 for i in common server; do 115 115 if [ ! -s "/usr/share/linuxmuster/tasks/$i" ]; then 116 116 echo "Error: Taskfile $i not found!" | tee -a $logfile … … 129 129 # tweaking buggy sophomorix, install postgresql first 130 130 aptitude update | tee -a $logfile 131 DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql | tee -a $logfile131 DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql-8.4 | tee -a $logfile 132 132 #DEBIAN_FRONTEND=noninteractive aptitude -y install postgresql-8.1 | tee -a $logfile 133 133 … … 161 161 162 162 --modify) 163 164 # disabled 165 exit 0 163 166 164 167 # check for installed flag -
main/linuxmuster-base/branches/testing/share/config/dist.conf
r1206 r1207 20 20 FREECDNAME=$(echo $FREEDISTNAME | awk '{ print $1 }')$(echo $CDVERSION | sed -e 's/\.//g')_i386.iso 21 21 ISOURL=http://lml.support-netz.de/open/iso 22 23 # rembo/myshn24 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"31 22 32 23 # linuxmuster … … 74 65 SHARELINK="__tauschen" 75 66 STUDENTSLINK="_schueler" 76 MYSHNLINK="_myshn"77 67 # default timeout, 1 second steps 78 68 TIMEOUT=60 -
main/linuxmuster-base/branches/testing/share/scripts/linuxmuster-patch
r1206 r1207 44 44 # only in modify mode 45 45 if [ "$1" != "--first" ]; then 46 # to be sure imaging packages are installed in case of imaging change47 linuxmuster-task --unattended --install=imaging-$imaging48 49 46 # reading old values 50 47 echo "Checking for modified values ..." … … 204 201 fi 205 202 203 # check if sophomorix is installed 204 SOPHOMORIX="$(dpkg -l sophomorix2 | grep -q ^i)" 206 205 207 206 # patching conffiles … … 257 256 s/@@adminmac@@/${mac_intern}/g 258 257 s/@@sambasid@@/${sambasid}/g 258 s/@@pgmadmin@@/${PGMADMIN}/g 259 259 s/@@domadmin@@/${DOMADMIN}/g 260 260 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 1 lubuntu-desktop 2 xserver-xorg -
main/linuxmuster-base/branches/testing/share/tasks/server
r1206 r1207 5 5 aspell-de 6 6 bind9 7 cdrecord8 7 chkrootkit 9 8 clamav-daemon … … 17 16 cyrus-pop3d-2.2 18 17 dhcp3-server 19 firmware-linux-free20 firmware-linux-nonfree21 18 foomatic-filters-ppds 22 19 gollem … … 26 23 ingo1 27 24 kronolith2 25 language-pack-de 26 language-pack-de-base 28 27 ldap-utils 29 28 lha … … 33 32 libpam-ldap 34 33 libsasl2-modules 35 linux-headers-2.6-686-bigmem 36 linux-image-686-bigmem 37 linuxmuster-ipcop 34 linux-headers-server 35 linux-image-server 36 linux-firmware 37 linux-firmware-nonfree 38 linuxmuster-linbo 38 39 linuxmuster-nagios-base 39 40 linuxmuster-schulkonsole … … 42 43 mnemo2 43 44 mondo 44 moodle45 45 mysql-server 46 46 nag2 … … 77 77 portmap 78 78 postfix 79 postgresql-8.3 80 postgresql-client-8.3 79 postgresql-8.4 81 80 rar 82 81 razor … … 86 85 slapd 87 86 sophomorix2 87 tftpd-hpa 88 88 turba2 89 89 unace … … 91 91 unzip 92 92 uucp 93 webmin94 93 zip 95 94 zoo -
main/linuxmuster-base/branches/testing/var/config-dynamic/15_ldap/postpatch
r1031 r1207 1 1 # $Id$ 2 3 # remove smb.conf template again4 [ -e smb.conf ] && rm smb.conf5 6 2 7 3 # set samba sid … … 30 26 31 27 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 29 if [ -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 37 36 38 37 39 # patch sophomorix pgldap.conf with workgroup, server, internip and domainname40 template=/etc/sophomorix/pgldap/pgldap.conf41 [ "$1" = "--modify" ] && backup_file $template42 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 $template38 # 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 47 46 48 47 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 59 fi # installed 60 59 61 # only on fresh install 60 62 if [ "$1" = "--first" ]; then … … 75 77 rm -rf /var/log/sophomorix/user/* 76 78 77 # changing user's default shell to /bin/bash78 sed -e 's/^\$schueler_per_ssh=.*/\$schueler_per_ssh=\"yes\"\;/79 s/^\$lehrer_per_ssh=.*/\$lehrer_per_ssh=\"yes\"\;/' -i $SOPHOMORIXCONF80 81 79 # openldap access to ssl-certs 82 80 addgroup openldap ssl-cert … … 85 83 createuser -U postgres -S -D -R ldap 86 84 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 94 101 95 102 # new random password for ldap db user … … 145 152 # repair permissions 146 153 for i in /etc/ldap.secret /etc/smbldap-tools/smbldap_bind.conf /etc/sophomorix/pgldap/pgldap.conf; do 154 [ -e "$i" ] || continue 147 155 chown root:root $i 148 156 chmod 600 $i … … 162 170 163 171 # recreate ldap tree 164 sophomorix-dump-pg2ldap172 # sophomorix-dump-pg2ldap 165 173 174 rm -f /var/tmp/ldap.* 166 175 167 176 # start services again 168 177 /etc/init.d/nscd stop 169 /etc/init.d/s ambastop178 /etc/init.d/smbd stop 170 179 /etc/init.d/slapd stop 171 180 /etc/init.d/slapd start 172 /etc/init.d/s ambastart181 /etc/init.d/smbd start 173 182 /etc/init.d/nscd start 174 183 175 184 176 185 # finally create homes on first install 177 if [ "$1" = "--first" ]; then186 if [ "$1" = "--first" -a -n "$SOPHOMORIX" ]; then 178 187 sophomorix-repair --permissions 179 188 sophomorix-repair --repairhome -
main/linuxmuster-base/branches/testing/var/config-dynamic/15_ldap/prepatch
r787 r1207 1 # necessary to trick sophomorix 1 # $Id$ 2 2 3 if [ "$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 10 else 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 6 17 fi 7 /etc/init.d/postgresql-8.3 start8 18 19 /etc/init.d/postgresql-8.4 start 9 20 10 21 # clear samba browse cache 11 22 rm -f /var/lib/samba/wins.dat 12 23 13 14 # copy imaging related template15 cp smb.conf.$imaging smb.conf16 -
main/linuxmuster-base/branches/testing/var/config-dynamic/17_admins/prepatch
r787 r1207 15 15 16 16 # 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 22 30 23 31 # 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 4 if dpkg -l | grep moodle | grep -q ^i; then 5 6 if [ "$1" = "--first" ]; then 2 7 3 8 # create tables … … 7 12 rm -f /var/tmp/moodle.psql 8 13 9 fi14 fi 10 15 11 # secure permissions of config.php12 chown root:www-data /etc/moodle/config.php13 chmod 440 /etc/moodle/config.php16 # secure permissions of config.php 17 chown root:www-data /etc/moodle/config.php 18 chmod 440 /etc/moodle/config.php 14 19 15 20 # check config.php link 16 if [ ! -L /usr/share/moodle/config.php ]; then21 if [ ! -L /usr/share/moodle/config.php ]; then 17 22 [ -e /usr/share/moodle/config.php ] && rm -rf /usr/share/moodle/config.php 18 23 ln -s /etc/moodle/config.php /usr/share/moodle/config.php 19 fi24 fi 20 25 26 fi # 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 4 if dpkg -l | grep moodle | grep -q ^i; then 3 5 4 6 if [ "$1" = "--first" ]; then -
main/linuxmuster-base/branches/testing/var/config-dynamic/40_linbo/prepatch
r1206 r1207 1 1 # $Id$ 2 2 # 3 # check if imaging method is linbo4 3 5 if [ "$imaging" = "linbo" ]; then 4 # create tftpd-hpa configs if necessary 5 tpldir="/usr/share/linuxmuster-linbo/templates" 6 tpl="$tpldir/tftpd-hpa.default" 7 conf="/etc/default/tftpd-hpa" 8 if ! grep -q "$LINBODIR" "$conf"; then 9 echo "Patching $conf." 10 backup_file "$conf" 11 sed -e "s|@@linbodir@@|$LINBODIR|" "$tpl" > "$conf" 12 fi 13 conf="/etc/tftp_remap.conf" 14 tpl="$tpldir/$(basename $conf)" 15 if [ ! -e "$conf" ]; then 16 echo "Providing $conf." 17 cp "$tpl" "$conf" 18 fi 6 19 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 21 conf=/etc/inetd.conf 22 if grep -q ^tftp "$conf"; then 23 echo "Deactivating tftp in $conf." 24 backup_file "$conf" 25 sed -e 's|^tftp|#tftp|' -i "$conf" 26 fi 27 28 # stuff to do on first time install 29 if [ "$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 15 37 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 22 40 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 41 else # modify 30 42 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 38 47 else 39 echo "linbo:$adminpw" >> /etc/rsyncd.secrets48 backup_file $SYSCONFDIR/workstations 40 49 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 185 51 fi 186 52 187 53 fi 188 54 55 touch $SYSCONFDIR/workstations 56 57 # patch path to wimport_data in dist.conf 58 backup_file /usr/share/linuxmuster/config/dist.conf 59 sed -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 62 if ! 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 66 fi 67 chmod 600 /etc/rsyncd.secrets 68 69 # check for initial rsync configuration and copy it if necessary 70 teststr="# automatically created by linuxmuster-setup" 71 grep "$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 78 if ! 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 85 fi 86 if ! 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 91 fi 92 93 # patch start.confs with serverip 94 for 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 97 done 98 99 # patch regs with workgroup 100 for 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 104 done 105 106 # patch start variables of tftpd-hpa and rsync 107 sed -e "s/^RUN_DAEMON=.*/RUN_DAEMON=yes/" -i /etc/default/tftpd-hpa 108 sed -e "s/^RSYNC_ENABLE=.*/RSYNC_ENABLE=true/" -i /etc/default/rsync 109 110 # check for images and start multicast 111 update-rc.d linbo-multicast defaults 112 res=`find $LINBODIR -name '*.cloop'` 113 if [ -n "$res" ]; then 114 sed -e "s/^START_MULTICAST=.*/START_MULTICAST=yes/" -i /etc/default/linuxmuster-linbo 115 /etc/init.d/linbo-multicast start 116 else 117 sed -e "s/^START_MULTICAST=.*/START_MULTICAST=no/" -i /etc/default/linuxmuster-linbo 118 fi 119 120 # linbo administrative user 121 if ! 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 134 fi 135 136 # check for linbo mail wrapper in /etc/aliases 137 if ! grep -q ^linbo: /etc/aliases; then 138 backup_file /etc/aliases 139 sed -e "/^root:/a\ 140 linbo: \"\|\/usr\/share\/linuxmuster-linbo\/mail2log.sh\"" -i /etc/aliases 141 newaliases 142 fi 143 144 # change owner of logdir to nobody 145 [ -d "$LOGDIR/linbo" ] || mkdir -p $LOGDIR/linbo 146 chown 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 153 if [ "$1" != "--first" ]; then 154 /etc/init.d/bittorrent start 155 /etc/init.d/linbo-bittorrent start 156 /etc/init.d/linbo-multicast start 157 else 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 161 fi 162
Note: See TracChangeset
for help on using the changeset viewer.
