Changeset 844


Ignore:
Timestamp:
09/06/10 17:57:36 (17 months ago)
Author:
tschmitt
Message:
  • update-logins.sh, Fix: Logins mit id < 10000 wurden nicht gelistet (#204).
  • postinst: Moodle's ldap host url wird korrigiert (#284).
  • import_printers: Aufruf des Cups Initskripts korrigiert (#287).
Location:
main/linuxmuster-base/branches/testing
Files:
4 edited

Legend:

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

    r842 r844  
     1linuxmuster-base (1.5.17-lenny0) lenny; urgency=low 
     2 
     3  * update-logins.sh: fixed logins with id < 10000 (#204). 
     4  * postinst: fixing moodle's ldap host url (#284). 
     5  * import_printers: fixed invokation of cups' init script (#287). 
     6 
     7 -- Thomas Schmitt <schmitt@lmz-bw.de>  Mon,  6 Sep 2010 17:47:21 +0200 
     8 
    19linuxmuster-base (1.5.16-lenny1) lenny; urgency=low 
    210 
  • main/linuxmuster-base/branches/testing/debian/postinst

    r833 r844  
    4646         linuxmuster-base/mac_wlan linuxmuster-base/mac_dmz linuxmuster-base/imaging; do 
    4747 
    48         if ! db_get linuxmuster-base/$i; then 
    49                 db_set linuxmuster-base/$i "" || true 
    50                 db_go 
    51         fi 
     48 if ! db_get linuxmuster-base/$i; then 
     49  db_set linuxmuster-base/$i "" || true 
     50  db_go 
     51 fi 
    5252 
    5353done 
    5454 
    5555case "$1" in 
    56     configure) 
    57  
    58       # read linuxmuster defaults 
    59       . /usr/share/linuxmuster/config/dist.conf 
    60  
    61       # make configs executable so that perl scripts can source it 
    62       chmod 755 /usr/share/linuxmuster/config/dist.conf 
    63       chmod 755 /etc/linuxmuster/backup.conf 
    64       [ -e /etc/default/linuxmuster-base ] && chmod 755 /etc/default/linuxmuster-base 
    65  
    66       # only root may use helperfunctions.sh 
    67       chmod 600 $HELPERFUNCTIONS 
    68  
    69       # check all necessary dirs and links and create them if needed 
    70       for i in $NETLOGONDIR $PROGSDIR $CDSDIR $BACKUPDIR $BACKUPMNTPOINT \ 
    71                $LOGINCACHE $LOGDIR; do 
    72  
    73         [ -d "$i" ] || mkdir -p $i 
    74  
    75       done 
    76  
    77       # add startup scripts to runlevels 
    78       update-rc.d linuxmuster-base defaults 
    79       update-rc.d linuxmuster-nic-setup start 40 S . 
    80  
    81       # create and correct dirs and files 
    82       [ -d /etc/skel/windows ] && rm -rf /etc/skel/windows 
    83       [ -d /etc/skel/cups-pdf ] && rm -rf /etc/skel/cups-pdf 
    84       [ -e /etc/linuxmuster/workstations ] || touch /etc/linuxmuster/workstations 
    85       [ -e "$BLOCKEDHOSTSINTERNET" ] || touch $BLOCKEDHOSTSINTERNET 
    86       [ -e "$BLOCKEDHOSTSINTRANET" ] || touch $BLOCKEDHOSTSINTRANET 
    87       [ -e "$UNFILTEREDHOSTS" ] || touch $UNFILTEREDHOSTS 
    88  
    89       # dummy dhcpd.conf 
    90       if [ ! -f "$DHCPDCONF" ]; then 
    91         [ -d "${DHCPDCONF%/*}" ] || mkdir -p ${DHCPDCONF%/*} 
    92         touch $DHCPDCONF 
     56 
     57 configure) 
     58 
     59  # read linuxmuster defaults 
     60  . /usr/share/linuxmuster/config/dist.conf 
     61 
     62  # make configs executable so that perl scripts can source it 
     63  chmod 755 /usr/share/linuxmuster/config/dist.conf 
     64  chmod 755 /etc/linuxmuster/backup.conf 
     65  [ -e /etc/default/linuxmuster-base ] && chmod 755 /etc/default/linuxmuster-base 
     66 
     67  # only root may use helperfunctions.sh 
     68  chmod 600 $HELPERFUNCTIONS 
     69 
     70  # check all necessary dirs and links and create them if needed 
     71  for i in $NETLOGONDIR $PROGSDIR $CDSDIR $BACKUPDIR $BACKUPMNTPOINT $LOGINCACHE $LOGDIR; do 
     72   [ -d "$i" ] || mkdir -p $i 
     73  done 
     74 
     75  # add startup scripts to runlevels 
     76  update-rc.d linuxmuster-base defaults 
     77  update-rc.d linuxmuster-nic-setup start 40 S . 
     78 
     79  # create and correct dirs and files 
     80  [ -d /etc/skel/windows ] && rm -rf /etc/skel/windows 
     81  [ -d /etc/skel/cups-pdf ] && rm -rf /etc/skel/cups-pdf 
     82  [ -e /etc/linuxmuster/workstations ] || touch /etc/linuxmuster/workstations 
     83  [ -e "$BLOCKEDHOSTSINTERNET" ] || touch $BLOCKEDHOSTSINTERNET 
     84  [ -e "$BLOCKEDHOSTSINTRANET" ] || touch $BLOCKEDHOSTSINTRANET 
     85  [ -e "$UNFILTEREDHOSTS" ] || touch $UNFILTEREDHOSTS 
     86 
     87  # dummy dhcpd.conf 
     88  if [ ! -f "$DHCPDCONF" ]; then 
     89   [ -d "${DHCPDCONF%/*}" ] || mkdir -p ${DHCPDCONF%/*} 
     90   touch $DHCPDCONF 
     91  fi 
     92 
     93  # system groups and users which are needed by udevd 
     94  for i in fuse kvm nvram rdma scanner tss; do 
     95   if ! grep -q ^${i}: /etc/group; then 
     96    addgroup --system $i 
     97   fi 
     98  done 
     99  if ! grep -q ^tss: /etc/passwd; then 
     100   adduser --system --no-create-home --ingroup tss --disabled-login tss 
     101  fi 
     102 
     103  # check debian_version 
     104  DEBIANVERSION=`cat /etc/debian_version` 
     105  if ! echo "$DEBIANVERSION" | grep -q "5.0"; then 
     106   echo "Please upgrade your system!" 
     107   exit 0 
     108  fi 
     109 
     110  # upgrade tasks 
     111  if [ -e "$INSTALLED" ]; then 
     112 
     113   if ! . $HELPERFUNCTIONS; then 
     114    echo "Cannot read $HELPERFUNCTIONS!" 
     115    exit 1 
     116   fi 
     117 
     118   if ! id $ADMINISTRATOR &> /dev/null; then 
     119    echo "LDAP-Service is not running! Skipping package configuration." 
     120    echo "Please do this manually by invoking" 
     121    echo "# dpkg-reconfigure linuxmuster-base" 
     122    echo "after you have fixed this issue." 
     123    exit 0 
     124   fi 
     125 
     126   # messages for config file headers 
     127   message1="##### Do not change this file! It will be overwritten!" 
     128   message2="##### This configuration file was automatically created by linuxmuster-base!" 
     129   message3="##### Last Modification: `date`" 
     130 
     131   # some variables we need for patching 
     132   # added imaging (1.2-6) 
     133   servername=`hostname -s` 
     134   domainname=`dnsdomainname` 
     135   db_get linuxmuster-base/country || true 
     136   country=$RET 
     137   db_get linuxmuster-base/state || true 
     138   state=$RET 
     139   db_get linuxmuster-base/location || true 
     140   location=$RET 
     141   db_get linuxmuster-base/schoolname || true 
     142   schoolname=$RET 
     143   db_get linuxmuster-base/workgroup || true 
     144   workgroup=$RET 
     145   workgroup=${workgroup#[0-9] } 
     146   internsub=`echo $serverip | awk -F. '{ print $2 }'` 
     147   serverrev_short=1.1.$internsub 
     148   ipcoprev_short=254.1.$internsub 
     149 
     150   # patch samba 
     151   sed -e "s/@@message1@@/${message1}/g 
     152           s/@@message2@@/${message2}/g 
     153           s/@@message3@@/${message3}/g 
     154           s/@@serverip@@/${serverip}/g 
     155           s/@@internmask@@/${internmask}/g 
     156           s/@@workgroup@@/${workgroup}/g 
     157           s/@@domadmin@@/${DOMADMIN}/g 
     158           s/@@administrator@@/${ADMINISTRATOR}/g 
     159           s/@@domadmins@@/${DOMADMINS}/g 
     160           s/@@teachersgroup@@/${TEACHERSGROUP}/g 
     161           s/@@basedn@@/${basedn}/g" $SMBCONFTEMPLATE.$imaging > /etc/samba/smb.conf 
     162   # samba reload only if postgres and/or samba are running 
     163   if ps ax | grep slapd | grep -v grep &> /dev/null; then 
     164    if ps ax | grep smbd | grep -v grep &> /dev/null; then 
     165     /etc/init.d/samba reload 
     166     # restore samba ldap admin password 
     167     which smbpasswd &> /dev/null && smbpasswd -w `cat /etc/ldap.secret` 
     168    else 
     169     echo "Samba is not running! Skipping samba reload!" 
     170     echo "You have to restart samba after package update!" 
     171    fi 
     172   else 
     173    echo "The LDAP daemon (slapd) is not running! Skipping samba reload!" 
     174    echo "You have to reload samba after package update!" 
     175   fi 
     176 
     177   # repair false basedn in slapd.conf 
     178   conf=/etc/ldap/slapd.conf ; backup=false 
     179   if [ "$basedn" != "dc=paedml-linux,dc=lokal" ]; then 
     180    if grep -q "dc=paedml-linux,dc=lokal" $conf; then 
     181     echo "Repairing basedn in $conf." 
     182     cp $conf $conf.dpkg-old 
     183     backup=true 
     184     sed -e "s|dc=paedml-linux,dc=lokal|$basedn|g" -i $conf 
     185     slapd_reload=yes 
     186    fi 
     187   fi 
     188   # repair password-hash in slapd.conf 
     189   if ! grep ^password-hash $conf | grep -q SSHA; then 
     190    echo "Fixing password-hash in $conf." 
     191    if [ "$backup" = "false" ]; then 
     192     cp $conf $conf.dpkg-old 
     193     backup=true 
     194    fi 
     195    sed -e 's|^password-hash.*|password-hash \{SSHA\}|' -i $conf 
     196    slapd_reload=yes 
     197   fi 
     198   # repair userPassword in slapd.conf 
     199   if grep -q "sambaAcctFlags,userpassword" $conf; then 
     200    echo "Fixing userpassword syntax error in $conf." 
     201    [ "$backup" = "false" ] && cp $conf $conf.dpkg-old 
     202    sed -e 's|sambaAcctFlags,userpassword|sambaAcctFlags,userPassword|g' -i $conf 
     203    slapd_reload=yes 
     204   fi 
     205   # openldap permissions 
     206   chown root:openldap ${conf}* 
     207   chmod 640 ${conf}* 
     208   # repair ldaps 
     209   conf=/etc/default/slapd ; backup=false 
     210   if ! grep ^SLAPD_SERVICES $conf | grep -q ldaps; then 
     211    echo "Fixing ldaps in $conf." 
     212    cp $conf $conf.dpkg-old 
     213    cp $STATICTPLDIR/$conf $conf 
     214    slapd_reload=yes 
     215   fi 
     216   if ! grep -q ^"SLAPD_OPTIONS=\"\-4\"" $conf; then 
     217    echo "Disabling IPv6 support in $conf." 
     218    [ "$backup" = "false" ] && cp $conf $conf.dpkg-old 
     219    cp $STATICTPLDIR/$conf $conf 
     220    slapd_reload=yes 
     221   fi 
     222 
     223   # fixing cups init start nr 
     224   if [ -e /etc/rc2.d/S20cups ]; then 
     225    echo "Fixing cups' init start nr ..." 
     226    update-rc.d -f cups remove 
     227    update-rc.d cups start 21 2 3 4 5 . stop 19 0 1 6 . 
     228    cups_restart=yes 
     229   fi 
     230   if [ -n "$cups_restart" ]; then 
     231    /etc/init.d/cups force-reload || true 
     232   fi 
     233 
     234   # extraschueler.txt, extrakurse.txt 
     235   for i in extraschueler.txt extrakurse.txt entfernen.txt sperrklassen.txt; do 
     236    [ -e "/etc/sophomorix/user/$i" ] || cp $STATICTPLDIR/etc/sophomorix/user/$i /etc/sophomorix/user 
     237   done 
     238 
     239   # restoring internal firewall 
     240   . /etc/default/linuxmuster-base 
     241   if [ "$START_LINUXMUSTER" = "yes" ]; then 
     242    if ! iptables -L | grep -q "$FIREWALLTEST"; then 
     243     /etc/init.d/linuxmuster-base start 
     244    fi 
     245   fi 
     246 
     247   # patch path to wimport_data in dist.conf (1.1-8) 
     248   if [ -n "$imaging" ]; then 
     249    case "$imaging" in 
     250     rembo) 
     251      sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$REMBOFILES\/files\/global\/wimport_data\"/" -i /usr/share/linuxmuster/config/dist.conf 
     252     ;; 
     253     *) 
     254      sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$SYSCONFDIR\/workstations\"/" -i /usr/share/linuxmuster/config/dist.conf 
     255      if [[ -L "$SYSCONFDIR/workstations" && -f "$REMBOFILES/files/global/wimport_data" ]]; then 
     256       rm $SYSCONFDIR/workstations 
     257       cp $REMBOFILES/files/global/wimport_data $SYSCONFDIR/workstations 
    93258      fi 
    94  
    95       # system groups and users which are needed by udevd 
    96       for i in fuse kvm nvram rdma scanner tss; do 
    97         if ! grep -q ^${i}: /etc/group; then 
    98           addgroup --system $i 
    99         fi 
    100       done 
    101       if ! grep -q ^tss: /etc/passwd; then 
    102         adduser --system --no-create-home --ingroup tss --disabled-login tss 
     259     ;; 
     260    esac 
     261   fi 
     262 
     263   # reparing permissions in netlogondir (1.5.3-1) 
     264   echo "Repairing permissions in $NETLOGONDIR ..." 
     265   find $NETLOGONDIR/ -type f -exec chmod 664 '{}' \; 
     266   find $NETLOGONDIR/ -type d -exec chmod 775 '{}' \; 
     267   chown $ADMINISTRATOR:$DOMADMINS $NETLOGONDIR -R 
     268 
     269   # linking registry-patches to administrator's home (1.2-15) 
     270   if [ ! -e "$ADMINSHOME/$ADMINISTRATOR/registry-patches" ]; then 
     271    echo "Linking registry-patches to administrator's home ..." 
     272    ln -sf /usr/share/linuxmuster/registry-patches $ADMINSHOME/$ADMINISTRATOR/registry-patches 
     273   fi 
     274 
     275   # linbo related update stuff 
     276   if [ "$imaging" = "linbo" ]; then 
     277    # linbo administrative user 
     278    if ps ax | grep -v grep | grep -q slapd && ps ax | grep -v grep | grep -q postgresql; then 
     279     if ! check_id linbo &>/dev/null; then 
     280      linbopasswd=`grep ^linbo /etc/rsyncd.secrets | awk -F\: '{ print $2 }'` 
     281      if [ -n "$linbopasswd" ]; then 
     282       echo "Creating linbo user ..." 
     283       sophomorix-useradd --administrator linbo --unix-group $ADMINGROUP --shell /bin/false --gecos "LINBO Administrator" &> /dev/null || true 
     284       sophomorix-passwd --user linbo --pass $linbopasswd &> /dev/null || true 
     285       smbldap-usermod -H '[UX         ]' linbo || true 
    103286      fi 
    104  
    105       # check debian_version 
    106       DEBIANVERSION=`cat /etc/debian_version` 
    107       if ! echo "$DEBIANVERSION" | grep -q "5.0"; then 
    108         echo "Please upgrade your system!" 
    109         exit 0 
    110       fi 
    111  
    112       # upgrade tasks 
    113       if [ -e "$INSTALLED" ]; then 
    114  
    115        if ! . $HELPERFUNCTIONS; then 
    116         echo "Cannot read $HELPERFUNCTIONS!" 
    117         exit 1 
    118        fi 
    119  
    120        if ! id $ADMINISTRATOR &> /dev/null; then 
    121         echo "LDAP-Service is not running! Skipping package configuration." 
    122         echo "Please do this manually by invoking" 
    123         echo "# dpkg-reconfigure linuxmuster-base" 
    124         echo "after you have fixed this issue." 
    125         exit 0 
    126        fi 
    127  
    128        # messages for config file headers 
    129        message1="##### Do not change this file! It will be overwritten!" 
    130        message2="##### This configuration file was automatically created by linuxmuster-base!" 
    131        message3="##### Last Modification: `date`" 
    132  
    133        # some variables we need for patching 
    134        # added imaging (1.2-6) 
    135        servername=`hostname -s` 
    136        domainname=`dnsdomainname` 
    137        db_get linuxmuster-base/country || true 
    138        country=$RET 
    139        db_get linuxmuster-base/state || true 
    140        state=$RET 
    141        db_get linuxmuster-base/location || true 
    142        location=$RET 
    143        db_get linuxmuster-base/schoolname || true 
    144        schoolname=$RET 
    145        db_get linuxmuster-base/workgroup || true 
    146        workgroup=$RET 
    147        workgroup=${workgroup#[0-9] } 
    148        internsub=`echo $serverip | awk -F. '{ print $2 }'` 
    149        serverrev_short=1.1.$internsub 
    150        ipcoprev_short=254.1.$internsub 
    151  
    152        # patch samba 
    153        sed -e "s/@@message1@@/${message1}/g 
    154                s/@@message2@@/${message2}/g 
    155                s/@@message3@@/${message3}/g 
    156                s/@@serverip@@/${serverip}/g 
    157                s/@@internmask@@/${internmask}/g 
    158                s/@@workgroup@@/${workgroup}/g 
    159                s/@@domadmin@@/${DOMADMIN}/g 
    160                s/@@administrator@@/${ADMINISTRATOR}/g 
    161                s/@@domadmins@@/${DOMADMINS}/g 
    162                s/@@teachersgroup@@/${TEACHERSGROUP}/g 
    163                s/@@basedn@@/${basedn}/g" $SMBCONFTEMPLATE.$imaging > /etc/samba/smb.conf 
    164        # samba reload only if postgres and/or samba are running 
    165        if ps ax | grep slapd | grep -v grep &> /dev/null; then 
    166         if ps ax | grep smbd | grep -v grep &> /dev/null; then 
    167          /etc/init.d/samba reload 
    168          # restore samba ldap admin password 
    169          which smbpasswd &> /dev/null && smbpasswd -w `cat /etc/ldap.secret` 
    170         else 
    171          echo "Samba is not running! Skipping samba reload!" 
    172          echo "You have to restart samba after package update!" 
    173         fi 
    174        else 
    175         echo "The LDAP daemon (slapd) is not running! Skipping samba reload!" 
    176         echo "You have to reload samba after package update!" 
    177        fi 
    178  
    179        # repair false basedn in slapd.conf 
    180        conf=/etc/ldap/slapd.conf ; backup=false 
    181        if [ "$basedn" != "dc=paedml-linux,dc=lokal" ]; then 
    182         if grep -q "dc=paedml-linux,dc=lokal" $conf; then 
    183          echo "Repairing basedn in $conf." 
    184          cp $conf $conf.dpkg-old 
    185          backup=true 
    186          sed -e "s|dc=paedml-linux,dc=lokal|$basedn|g" -i $conf 
    187          slapd_reload=yes 
    188         fi 
    189        fi 
    190        # repair password-hash in slapd.conf 
    191        if ! grep ^password-hash $conf | grep -q SSHA; then 
    192         echo "Fixing password-hash in $conf." 
    193         if [ "$backup" = "false" ]; then 
    194          cp $conf $conf.dpkg-old 
    195          backup=true 
    196         fi 
    197         sed -e 's|^password-hash.*|password-hash \{SSHA\}|' -i $conf 
    198         slapd_reload=yes 
    199        fi 
    200        # repair userPassword in slapd.conf 
    201        if grep -q "sambaAcctFlags,userpassword" $conf; then 
    202         echo "Fixing userpassword syntax error in $conf." 
    203         [ "$backup" = "false" ] && cp $conf $conf.dpkg-old 
    204         sed -e 's|sambaAcctFlags,userpassword|sambaAcctFlags,userPassword|g' -i $conf 
    205         slapd_reload=yes 
    206        fi 
    207        # openldap permissions 
    208        chown root:openldap ${conf}* 
    209        chmod 640 ${conf}* 
    210        # repair ldaps 
    211        conf=/etc/default/slapd ; backup=false 
    212        if ! grep ^SLAPD_SERVICES $conf | grep -q ldaps; then 
    213         echo "Fixing ldaps in $conf." 
    214         cp $conf $conf.dpkg-old 
    215         cp $STATICTPLDIR/$conf $conf 
    216         slapd_reload=yes 
    217        fi 
    218        if ! grep -q ^"SLAPD_OPTIONS=\"\-4\"" $conf; then 
    219         echo "Disabling IPv6 support in $conf." 
    220         [ "$backup" = "false" ] && cp $conf $conf.dpkg-old 
    221         cp $STATICTPLDIR/$conf $conf 
    222         slapd_reload=yes 
    223        fi 
    224  
    225        # fixing cups init start nr 
    226        if [ -e /etc/rc2.d/S20cups ]; then 
    227         echo "Fixing cups' init start nr ..." 
    228         update-rc.d -f cups remove 
    229         update-rc.d cups start 21 2 3 4 5 . stop 19 0 1 6 . 
    230         cups_restart=yes 
    231        fi 
    232        if [ -n "$cups_restart" ]; then 
    233         /etc/init.d/cups force-reload || true 
    234        fi 
    235  
    236        # extraschueler.txt, extrakurse.txt 
    237        for i in extraschueler.txt extrakurse.txt entfernen.txt sperrklassen.txt; do 
    238         [ -e "/etc/sophomorix/user/$i" ] || cp $STATICTPLDIR/etc/sophomorix/user/$i /etc/sophomorix/user 
    239        done 
    240  
    241        # restoring internal firewall 
    242        . /etc/default/linuxmuster-base 
    243        if [ "$START_LINUXMUSTER" = "yes" ]; then 
    244         if ! iptables -L | grep -q "$FIREWALLTEST"; then 
    245          /etc/init.d/linuxmuster-base start 
    246         fi 
    247        fi 
    248  
    249        # patch path to wimport_data in dist.conf (1.1-8) 
    250        if [ -n "$imaging" ]; then 
    251         case "$imaging" in 
    252          rembo) 
    253           sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$REMBOFILES\/files\/global\/wimport_data\"/" -i /usr/share/linuxmuster/config/dist.conf 
    254          ;; 
    255          *) 
    256           sed -e "s/^WIMPORTDATA=.*/WIMPORTDATA=\"\$SYSCONFDIR\/workstations\"/" -i /usr/share/linuxmuster/config/dist.conf 
    257           if [[ -L "$SYSCONFDIR/workstations" && -f "$REMBOFILES/files/global/wimport_data" ]]; then 
    258            rm $SYSCONFDIR/workstations 
    259            cp $REMBOFILES/files/global/wimport_data $SYSCONFDIR/workstations 
    260           fi 
    261          ;; 
    262         esac 
    263        fi 
    264  
    265        # reparing permissions in netlogondir (1.5.3-1) 
    266        echo "Repairing permissions in $NETLOGONDIR ..." 
    267        find $NETLOGONDIR/ -type f -exec chmod 664 '{}' \; 
    268        find $NETLOGONDIR/ -type d -exec chmod 775 '{}' \; 
    269        chown $ADMINISTRATOR:$DOMADMINS $NETLOGONDIR -R 
    270  
    271        # linking registry-patches to administrator's home (1.2-15) 
    272        if [ ! -e "$ADMINSHOME/$ADMINISTRATOR/registry-patches" ]; then 
    273         echo "Linking registry-patches to administrator's home ..." 
    274         ln -sf /usr/share/linuxmuster/registry-patches $ADMINSHOME/$ADMINISTRATOR/registry-patches 
    275        fi 
    276  
    277        # linbo related update stuff 
    278        if [ "$imaging" = "linbo" ]; then 
    279         # linbo administrative user 
    280         if ps ax | grep -v grep | grep -q slapd && ps ax | grep -v grep | grep -q postgresql; then 
    281          if ! check_id linbo &>/dev/null; then 
    282           linbopasswd=`grep ^linbo /etc/rsyncd.secrets | awk -F\: '{ print $2 }'` 
    283           if [ -n "$linbopasswd" ]; then 
    284            echo "Creating linbo user ..." 
    285            sophomorix-useradd --administrator linbo --unix-group $ADMINGROUP --shell /bin/false --gecos "LINBO Administrator" &> /dev/null || true 
    286            sophomorix-passwd --user linbo --pass $linbopasswd &> /dev/null || true 
    287            smbldap-usermod -H '[UX         ]' linbo || true 
    288           fi 
    289          fi 
    290         else 
    291          echo "slapd and/or postgresql not running! Skipping linbo user check!" 
    292         fi 
    293        fi # linbo 
    294  
    295        # creating ldap.secret links 
    296        [ -s /etc/ldap.secret ] || echo $(grep ^rootpw /etc/ldap/slapd.conf | awk '{ print $2 }') > /etc/ldap.secret 
    297        for i in pam_ldap libnss-ldap; do 
    298         rm -f /etc/$i.secret 
    299         ln -s ldap.secret /etc/$i.secret 
    300        done 
    301        chmod 700 /etc/*.secret 
    302  
    303        # repairing openntpd 
    304        if ! grep -q ^"listen on $serverip" /etc/openntpd/ntpd.conf; then 
    305         cp /etc/openntpd/ntpd.conf /etc/openntpd/ntpd.conf.dpkg-old 
    306         sed -e "s/@@serverip@@/$serverip/" $DYNTPLDIR/99_start-services/ntpd.conf > /etc/openntpd/ntpd.conf 
    307         /etc/init.d/openntpd restart 
    308        fi 
    309  
    310        # repairing webmin 
    311        if [ ! -d /var/log/webmin ]; then 
    312         mkdir -p /var/log/webmin 
    313         /etc/init.d/webmin restart 
    314        fi 
    315  
    316        # repairing moodle 
    317        if [ -e /etc/moodle/config.php ]; then 
    318         if ! grep -q "\$CFG->wwwroot = '/moodle';" /etc/moodle/config.php; then 
    319          cp /etc/moodle/config.php /etc/moodle/config.php.dpkg-old 
    320          sed -e "s/\$CFG->wwwroot =.*/\$CFG->wwwroot = \'\/moodle\';/g" -i /etc/moodle/config.php 
    321         fi 
    322        fi 
    323        if [ -d /usr/share/moodle ]; then 
    324         [[ -e /usr/share/moodle/moodle && ! -L /usr/share/moodle/moodle ]] && mv /usr/share/moodle/moodle /usr/share/moodle/moodle.dpkg-old 
    325         [ -L /usr/share/moodle/moodle ] || ln -s . /usr/share/moodle/moodle 
    326        fi 
    327  
    328        # repair ssl-cert permissions (1.4.37-paedml1 & 1.4.38-paedml1) 
    329        chgrp ssl-cert /etc/ssl/private -R 
    330        if grep -q root:sasl $SCRIPTSDIR/create-ssl-cert.sh; then 
    331         sed -e 's/root:sasl/root:ssl-cert/g' -i $SCRIPTSDIR/create-ssl-cert.sh 
    332         chmod 744 $SCRIPTSDIR/create-ssl-cert.sh 
    333        fi 
    334  
    335        # ldap db user needs password (1.4.44-1) 
    336        dbconf=/etc/linuxmuster/schulkonsole/db.conf 
    337        dbuser=`grep ^Username $dbconf | awk -F\= '{ print $2 }'` 
    338        dbpwd=`grep ^Password $dbconf | awk -F\= '{ print $2 }'` 
    339        if [ "$dbuser" != "ldap" -o -z "$dbpwd" ]; then 
    340         echo "Providing a random password for postgresql user ldap." 
    341         echo "Warning: Backing up /etc/linuxmuster/schulkonsole/db.conf to db.conf.dpkg-old!" 
    342         cp /etc/linuxmuster/schulkonsole/db.conf /etc/linuxmuster/schulkonsole/db.conf.dpkg-old 
    343         ldapdbpw=`pwgen -s 8 1` 
    344         psql -U postgres -d template1 -qc "ALTER USER ldap WITH PASSWORD '"$ldapdbpw"';" 
    345         sed -e "s/^Password=.*/Password=$ldapdbpw/" $STATICTPLDIR/etc/linuxmuster/schulkonsole/db.conf > /etc/linuxmuster/schulkonsole/db.conf 
    346         chown www-data:www-data /etc/linuxmuster/schulkonsole/db.conf* 
    347         chmod 400 /etc/linuxmuster/schulkonsole/db.conf* 
    348        fi 
    349  
    350        # removing obsolete apache modules 
    351        rm -f /etc/apache2/mods-enabled/mime_magic.* 
    352  
    353        # add clamav-freshclam startlinks 
    354        [[ ! -e /etc/rc2.d/S20clamav-freshclam && -e /etc/init.d/clamav-freshclam ]] && update-rc.d clamav-freshclam defaults 
    355  
    356        # updating release information 
    357        echo "$(getdistname) $DISTFULLVERSION / Codename $CODENAME" > /etc/issue 
    358        cp /etc/issue /etc/issue.net 
    359  
    360        # reload services 
    361        apache2ctl graceful || true 
    362        [ -n "$nagios_reload" ] && /etc/init.d/nagios2 restart 
    363        [ -n "$dhcp_reload" ] && /etc/init.d/dhcp3-server force-reload 
    364        [ -n "$slapd_reload" ] && /etc/init.d/slapd restart 
    365        [ -n "$postgres_reload" ] && /etc/init.d/postgresql-8.1 reload 
     287     fi 
     288    else 
     289     echo "slapd and/or postgresql not running! Skipping linbo user check!" 
     290    fi 
     291   fi # linbo 
     292 
     293   # creating ldap.secret links 
     294   [ -s /etc/ldap.secret ] || echo $(grep ^rootpw /etc/ldap/slapd.conf | awk '{ print $2 }') > /etc/ldap.secret 
     295   for i in pam_ldap libnss-ldap; do 
     296    rm -f /etc/$i.secret 
     297    ln -s ldap.secret /etc/$i.secret 
     298   done 
     299   chmod 700 /etc/*.secret 
     300 
     301   # repairing openntpd 
     302   if ! grep -q ^"listen on $serverip" /etc/openntpd/ntpd.conf; then 
     303    cp /etc/openntpd/ntpd.conf /etc/openntpd/ntpd.conf.dpkg-old 
     304    sed -e "s/@@serverip@@/$serverip/" $DYNTPLDIR/99_start-services/ntpd.conf > /etc/openntpd/ntpd.conf 
     305    /etc/init.d/openntpd restart 
     306   fi 
     307 
     308   # repairing webmin 
     309   if [ ! -d /var/log/webmin ]; then 
     310    mkdir -p /var/log/webmin 
     311    /etc/init.d/webmin restart 
     312   fi 
     313 
     314   # repairing moodle 
     315   if psql -U postgres -qtl | grep -q moodle; then 
     316    if [ -e /etc/moodle/config.php ]; then 
     317     if ! grep -q "\$CFG->wwwroot = '/moodle';" /etc/moodle/config.php; then 
     318      cp /etc/moodle/config.php /etc/moodle/config.php.dpkg-old 
     319      sed -e "s/\$CFG->wwwroot =.*/\$CFG->wwwroot = \'\/moodle\';/g" -i /etc/moodle/config.php 
     320     fi 
     321    fi 
     322    if [ -d /usr/share/moodle ]; then 
     323     [[ -e /usr/share/moodle/moodle && ! -L /usr/share/moodle/moodle ]] && mv /usr/share/moodle/moodle /usr/share/moodle/moodle.dpkg-old 
     324     [ -L /usr/share/moodle/moodle ] || ln -s . /usr/share/moodle/moodle 
     325    fi 
     326    # repairing ldap host url (#284) 
     327    hosturl="$(psql -U postgres -d moodle -qtc "SELECT value FROM mdl_config_plugins WHERE name = 'host_url'")" 
     328    if [ "$hosturl" != " ldap://localhost" ]; then 
     329     echo "Repairing moodle's ldap host url ..." 
     330     psql -U postgres -d moodle -qc "UPDATE mdl_config_plugins SET value = 'ldap://localhost' WHERE name = 'host_url';" 
     331    fi 
     332   fi 
     333 
     334   # repair ssl-cert permissions (1.4.37-paedml1 & 1.4.38-paedml1) 
     335   chgrp ssl-cert /etc/ssl/private -R 
     336   if grep -q root:sasl $SCRIPTSDIR/create-ssl-cert.sh; then 
     337    sed -e 's/root:sasl/root:ssl-cert/g' -i $SCRIPTSDIR/create-ssl-cert.sh 
     338    chmod 744 $SCRIPTSDIR/create-ssl-cert.sh 
     339   fi 
     340 
     341   # ldap db user needs password (1.4.44-1) 
     342   dbconf=/etc/linuxmuster/schulkonsole/db.conf 
     343   dbuser=`grep ^Username $dbconf | awk -F\= '{ print $2 }'` 
     344   dbpwd=`grep ^Password $dbconf | awk -F\= '{ print $2 }'` 
     345   if [ "$dbuser" != "ldap" -o -z "$dbpwd" ]; then 
     346    echo "Providing a random password for postgresql user ldap." 
     347    echo "Warning: Backing up /etc/linuxmuster/schulkonsole/db.conf to db.conf.dpkg-old!" 
     348    cp /etc/linuxmuster/schulkonsole/db.conf /etc/linuxmuster/schulkonsole/db.conf.dpkg-old 
     349    ldapdbpw=`pwgen -s 8 1` 
     350    psql -U postgres -d template1 -qc "ALTER USER ldap WITH PASSWORD '"$ldapdbpw"';" 
     351    sed -e "s/^Password=.*/Password=$ldapdbpw/" $STATICTPLDIR/etc/linuxmuster/schulkonsole/db.conf > /etc/linuxmuster/schulkonsole/db.conf 
     352    chown www-data:www-data /etc/linuxmuster/schulkonsole/db.conf* 
     353    chmod 400 /etc/linuxmuster/schulkonsole/db.conf* 
     354   fi 
     355 
     356   # removing obsolete apache modules 
     357   rm -f /etc/apache2/mods-enabled/mime_magic.* 
     358 
     359   # add clamav-freshclam startlinks 
     360   [[ ! -e /etc/rc2.d/S20clamav-freshclam && -e /etc/init.d/clamav-freshclam ]] && update-rc.d clamav-freshclam defaults 
     361 
     362   # updating release information 
     363   echo "$(getdistname) $DISTFULLVERSION / Codename $CODENAME" > /etc/issue 
     364   cp /etc/issue /etc/issue.net 
     365 
     366   # reload services 
     367   apache2ctl graceful || true 
     368   [ -n "$nagios_reload" ] && /etc/init.d/nagios2 restart 
     369   [ -n "$dhcp_reload" ] && /etc/init.d/dhcp3-server force-reload 
     370   [ -n "$slapd_reload" ] && /etc/init.d/slapd restart 
     371   [ -n "$postgres_reload" ] && /etc/init.d/postgresql-8.1 reload 
    366372         
    367        # important message if upgrade is necessary 
    368        if [ -n "$upgrade" ]; then 
    369         echo "IMPORTANT!" 
    370         echo "Be sure to make apt-get update and apt-get dist-upgrade very soon!" 
    371        fi 
    372  
    373       fi # upgrade tasks 
    374  
    375       ;; 
    376  
    377     abort-upgrade|abort-remove|abort-deconfigure) 
    378  
    379     ;; 
    380  
    381     *) 
    382         echo "postinst called with unknown argument \`$1'" >&2 
    383         exit 1 
    384     ;; 
     373   # important message if upgrade is necessary 
     374   if [ -n "$upgrade" ]; then 
     375    echo "IMPORTANT!" 
     376    echo "Be sure to make apt-get update and apt-get dist-upgrade very soon!" 
     377   fi 
     378 
     379  fi # upgrade tasks 
     380 ;; 
     381 
     382 abort-upgrade|abort-remove|abort-deconfigure) 
     383 ;; 
     384 
     385 *) 
     386  echo "postinst called with unknown argument \`$1'" >&2 
     387  exit 1 
     388 ;; 
     389 
    385390esac 
    386391 
  • main/linuxmuster-base/branches/testing/sbin/import_printers

    r787 r844  
    1 #!/bin/sh 
     1#!/bin/bash 
    22# 
    33# creates /etc/cups/access.conf for printer access definitions 
    4  
    5 #set -x 
     4# GPL v3 
     5# Thomas Schmitt <schmitt@lmz-bw.de> 
     6# 
     7# $Id$ 
     8# 
    69 
    710# source linuxmuster defaults 
     
    6366mv $ACCESSCONF.new $ACCESSCONF || cancel "Cannot write $ACCESSCONF!" 
    6467 
    65 /etc/init.d/cupsys restart || cancel "Cannot restart CUPS!" 
     68/etc/init.d/cups restart || cancel "Cannot restart CUPS!" 
    6669 
    6770[ -e "$ACCESSCONF.off" ] && rm -f $ACCESSCONF.off 
  • main/linuxmuster-base/branches/testing/share/scripts/update-logins.sh

    r666 r844  
    55# Thomas Schmitt <schmitt@lmz-bw.de> 
    66# 
    7 # 2010-03-08 
     7# $Id$ 
    88# 
    99 
     
    4848  msg=false 
    4949  # read smbstatus file and grep logins from it 
    50   grep ^[1-9] $status | while read line; do 
     50  grep "!^\s*![1-9]" $status | while read line; do 
    5151   machine="$(echo $line | awk '{ print $4 }')" 
    5252   echo $hosts | grep -qw $machine || continue 
Note: See TracChangeset for help on using the changeset viewer.