Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 10 insertions, 10 deletions
jessie2stretch.sh
| @@ -133,16 +133,16 @@ pg_dropcluster 9.4 main | |||
| 133 | 133 | # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
| 134 | 134 | ||
| 135 | 135 | # remove old squeeze packages left around (keep eyes open!) | |
| 136 | - | apt-get autoremove && \ | |
| 137 | - | apt-get purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| 138 | - | apt-get purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') && \ | |
| 139 | - | apt-get purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
| 140 | - | apt-get purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 141 | - | apt-get purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 142 | - | apt-get purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') && \ | |
| 143 | - | apt-get purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 144 | - | aptitude -y install deborphan && apt-get purge $(deborphan | grep -v xen | grep -v libpam-cracklib | awk '/^rc/ { print $2 }') | |
| 145 | - | apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 136 | + | apt autoremove && \ | |
| 137 | + | apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| 138 | + | apt purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') && \ | |
| 139 | + | apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
| 140 | + | apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 141 | + | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 142 | + | apt purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') && \ | |
| 143 | + | apt purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 144 | + | aptitude -y install deborphan && apt purge $(deborphan | grep -v xen | grep -v libpam-cracklib | awk '/^rc/ { print $2 }') | |
| 145 | + | apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 146 | 146 | ||
| 147 | 147 | # for the brave YoloOps crowd | |
| 148 | 148 | reboot && sleep 180; echo u > /proc/sysrq-trigger ; sleep 2 ; echo s > /proc/sysrq-trigger ; sleep 2 ; echo b > /proc/sysrq-trigger | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 4 insertions
jessie2stretch.sh
| @@ -110,6 +110,10 @@ apt-get dist-upgrade | |||
| 110 | 110 | # Fix IfModule mod_php5 in apache2 vHosts | |
| 111 | 111 | sed -i "s/IfModule mod_php5/IfModule mod_php7/g" /etc/apache2/sites-available/* | |
| 112 | 112 | ||
| 113 | + | # Fix our ssh pub key package configuration | |
| 114 | + | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 115 | + | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 116 | + | ||
| 113 | 117 | # Upgrade postgres | |
| 114 | 118 | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 115 | 119 | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 4 insertions, 1 deletion
jessie2stretch.sh
| @@ -97,7 +97,7 @@ if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/conf | |||
| 97 | 97 | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 98 | 98 | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 99 | 99 | ||
| 100 | - | # Move configs from MySQl to MariaDB config location | |
| 100 | + | # Move configs from MySQl to MariaDB config location (e.g.) | |
| 101 | 101 | mv /etc/mysql/conf.d/bind.cnf /etc/mysql/mariadb.conf.d/90-bind.cnf | |
| 102 | 102 | ||
| 103 | 103 | # maybe we want to change some shorewall config stuff again | |
| @@ -107,6 +107,9 @@ systemctl enable shorewall | |||
| 107 | 107 | # full-upgrade | |
| 108 | 108 | apt-get dist-upgrade | |
| 109 | 109 | ||
| 110 | + | # Fix IfModule mod_php5 in apache2 vHosts | |
| 111 | + | sed -i "s/IfModule mod_php5/IfModule mod_php7/g" /etc/apache2/sites-available/* | |
| 112 | + | ||
| 110 | 113 | # Upgrade postgres | |
| 111 | 114 | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 112 | 115 | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 1 insertion, 1 deletion
jessie2stretch.sh
| @@ -8,7 +8,7 @@ dpkg-reconfigure locales | |||
| 8 | 8 | rm -rf /etc/network/options /etc/environment | |
| 9 | 9 | ||
| 10 | 10 | # migrate over to systemd (before the upgrade) | |
| 11 | - | aptitude install systemd | |
| 11 | + | aptitude install systemd systemd-sysv | |
| 12 | 12 | ||
| 13 | 13 | # Disable loading defaults.vim | |
| 14 | 14 | echo '" disable the loading of defaults.vim' >> /etc/vim/vimrc.local | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 3 insertions
jessie2stretch.sh
| @@ -97,6 +97,9 @@ if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/conf | |||
| 97 | 97 | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 98 | 98 | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 99 | 99 | ||
| 100 | + | # Move configs from MySQl to MariaDB config location | |
| 101 | + | mv /etc/mysql/conf.d/bind.cnf /etc/mysql/mariadb.conf.d/90-bind.cnf | |
| 102 | + | ||
| 100 | 103 | # maybe we want to change some shorewall config stuff again | |
| 101 | 104 | # shorewall needs to be enabled via systemctl, /etc/default is not used by systemd | |
| 102 | 105 | systemctl enable shorewall | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 4 insertions, 4 deletions
jessie2stretch.sh
| @@ -92,10 +92,10 @@ cat >> $CFG <<EOF | |||
| 92 | 92 | EOF | |
| 93 | 93 | ||
| 94 | 94 | ## phpmyadmin | |
| 95 | - | #if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 96 | - | # else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| 97 | - | #sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 98 | - | #sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 95 | + | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 96 | + | else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| 97 | + | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 98 | + | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 99 | 99 | ||
| 100 | 100 | # maybe we want to change some shorewall config stuff again | |
| 101 | 101 | # shorewall needs to be enabled via systemctl, /etc/default is not used by systemd | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 5 deletions
jessie2stretch.sh
| @@ -91,11 +91,6 @@ cat >> $CFG <<EOF | |||
| 91 | 91 | ||
| 92 | 92 | EOF | |
| 93 | 93 | ||
| 94 | - | ## randomize crontab | |
| 95 | - | #if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
| 96 | - | #sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 97 | - | #sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 98 | - | ||
| 99 | 94 | ## phpmyadmin | |
| 100 | 95 | #if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 101 | 96 | # else CFG=/etc/phpmyadmin/config.inc.php; fi | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 14 deletions
jessie2stretch.sh
| @@ -67,20 +67,6 @@ EOF | |||
| 67 | 67 | # minimal system upgrade (keep sysvinit / see http://noone.org/talks/debian-ohne-systemd/debian-ohne-systemd-clt.html#%2811%29) | |
| 68 | 68 | aptitude upgrade | |
| 69 | 69 | ||
| 70 | - | ## (re)enable wheel | |
| 71 | - | #if [ -f /etc/pam.d/su.dpkg-new ]; then CFG=/etc/pam.d/su.dpkg-new; else CFG=/etc/pam.d/su; fi | |
| 72 | - | #sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.so/" $CFG | |
| 73 | - | ||
| 74 | - | ## (re)configure snmpd | |
| 75 | - | #COMMUNITY="mycommunity"; \ | |
| 76 | - | #if [ -f /etc/snmp/snmpd.conf.dpkg-new ]; then CFG=/etc/snmp/snmpd.conf.dpkg-new; \ | |
| 77 | - | # else CFG=/etc/snmp/snmpd.conf; fi | |
| 78 | - | #sed -i "s^#rocommunity secret 10.0.0.0/16^rocommunity $COMMUNITY^g" $CFG | |
| 79 | - | #sed -i s/#agentAddress/agentAddress/ $CFG | |
| 80 | - | #sed -i "s/^ rocommunity public/# rocommunity public/" $CFG | |
| 81 | - | #sed -i "s/^ rocommunity6 public/# rocommunity6 public/" $CFG | |
| 82 | - | #sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |
| 83 | - | ||
| 84 | 70 | ## fix our xen modification | |
| 85 | 71 | #rm -rf /etc/grub.d/09_linux_xen | |
| 86 | 72 | #dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen | |
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 8 insertions, 8 deletions
jessie2stretch.sh
| @@ -142,14 +142,14 @@ pg_dropcluster 9.4 main | |||
| 142 | 142 | # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
| 143 | 143 | ||
| 144 | 144 | # remove old squeeze packages left around (keep eyes open!) | |
| 145 | - | apt-get autoremove | |
| 146 | - | apt-get purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') | |
| 147 | - | apt-get purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') | |
| 148 | - | apt-get purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') | |
| 149 | - | apt-get purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') | |
| 150 | - | apt-get purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') | |
| 151 | - | apt-get purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') | |
| 152 | - | apt-get purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') | |
| 145 | + | apt-get autoremove && \ | |
| 146 | + | apt-get purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| 147 | + | apt-get purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') && \ | |
| 148 | + | apt-get purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
| 149 | + | apt-get purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 150 | + | apt-get purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 151 | + | apt-get purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') && \ | |
| 152 | + | apt-get purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 153 | 153 | aptitude -y install deborphan && apt-get purge $(deborphan | grep -v xen | grep -v libpam-cracklib | awk '/^rc/ { print $2 }') | |
| 154 | 154 | apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 155 | 155 | ||
Jan Wagner ha revisionato questo gist 8 years ago. Vai alla revisione
1 file changed, 1 insertion
jessie2stretch.sh
| @@ -34,6 +34,7 @@ sed -i "s/ stable/ stretch/g" /etc/apt/sources.list* | |||
| 34 | 34 | sed -i s/jessie/stretch/g /etc/apt/preferences* | |
| 35 | 35 | sed -i s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 36 | 36 | rename s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 37 | + | rgrep jessie /etc/apt/sources.list* | |
| 37 | 38 | aptitude update | |
| 38 | 39 | ||
| 39 | 40 | # check package status | |