Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 7 insertions
stretch2buster.sh
| @@ -107,6 +107,13 @@ systemctl restart nginx | |||
| 107 | 107 | # transition docker-ce to buster package | |
| 108 | 108 | DOCKER_VER="$(apt-cache policy docker-ce | grep debian-buster | head -1 | awk '{print $1}')" && [ -n "${DOCKER_VER}" ] && apt install docker-ce=${DOCKER_VER} docker-ce-cli=${DOCKER_VER} | |
| 109 | 109 | ||
| 110 | + | # Fixing systemd unit for chrooted unbound (https://bugs.debian.org/931583) | |
| 111 | + | mkdir -p /etc/systemd/system/unbound.service.d/ && cat > /etc/systemd/system/unbound.service.d/override.conf <<EOF | |
| 112 | + | [Service] | |
| 113 | + | BindPaths=/run/systemd/notify:/var/lib/unbound/run/systemd/notify | |
| 114 | + | EOF | |
| 115 | + | systemctl daemon-reload && systemctl restart unbound | |
| 116 | + | ||
| 110 | 117 | # remove old squeeze packages left around (keep eyes open!) | |
| 111 | 118 | apt autoremove && \ | |
| 112 | 119 | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|phpmyadmin' | awk '/^i *A/ { print $3 }') && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 3 insertions
stretch2buster.sh
| @@ -104,6 +104,9 @@ rename s/php70/php73/g /etc/nginx/conf.d/*php70*.conf | |||
| 104 | 104 | sed -i s/php7.0-fpm/php7.3-fpm/g /etc/nginx/conf.d/*.conf /etc/nginx/snippets/*.conf /etc/nginx/sites-available/* | |
| 105 | 105 | systemctl restart nginx | |
| 106 | 106 | ||
| 107 | + | # transition docker-ce to buster package | |
| 108 | + | DOCKER_VER="$(apt-cache policy docker-ce | grep debian-buster | head -1 | awk '{print $1}')" && [ -n "${DOCKER_VER}" ] && apt install docker-ce=${DOCKER_VER} docker-ce-cli=${DOCKER_VER} | |
| 109 | + | ||
| 107 | 110 | # remove old squeeze packages left around (keep eyes open!) | |
| 108 | 111 | apt autoremove && \ | |
| 109 | 112 | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|phpmyadmin' | awk '/^i *A/ { print $3 }') && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 10 insertions
stretch2buster.sh
| @@ -93,6 +93,16 @@ sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][ | |||
| 93 | 93 | apt-get dist-upgrade | |
| 94 | 94 | ||
| 95 | 95 | # Migrate (webserver) from php7.0 to php7.3 | |
| 96 | + | apt install $(dpkg -l |grep php7.0 | awk '/^i/ { print $2 }' |grep -v ^php7.0-opcache |sed s/php7.0/php/) | |
| 97 | + | ls -la /etc/php/7.0/*/conf.d/ | |
| 98 | + | # php-fpm | |
| 99 | + | tail -10 /etc/php/7.0/fpm/pool.d/www.conf | |
| 100 | + | vi /etc/php/7.3/fpm/pool.d/www.conf | |
| 101 | + | systemctl disable php7.0-fpm && systemctl stop php7.0-fpm && systemctl restart php7.3-fpm | |
| 102 | + | # nginx | |
| 103 | + | rename s/php70/php73/g /etc/nginx/conf.d/*php70*.conf | |
| 104 | + | sed -i s/php7.0-fpm/php7.3-fpm/g /etc/nginx/conf.d/*.conf /etc/nginx/snippets/*.conf /etc/nginx/sites-available/* | |
| 105 | + | systemctl restart nginx | |
| 96 | 106 | ||
| 97 | 107 | # remove old squeeze packages left around (keep eyes open!) | |
| 98 | 108 | apt autoremove && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 2 insertions
stretch2buster.sh
| @@ -92,6 +92,8 @@ sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][ | |||
| 92 | 92 | # full-upgrade | |
| 93 | 93 | apt-get dist-upgrade | |
| 94 | 94 | ||
| 95 | + | # Migrate (webserver) from php7.0 to php7.3 | |
| 96 | + | ||
| 95 | 97 | # remove old squeeze packages left around (keep eyes open!) | |
| 96 | 98 | apt autoremove && \ | |
| 97 | 99 | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|phpmyadmin' | awk '/^i *A/ { print $3 }') && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 2 insertions, 2 deletions
stretch2buster.sh
| @@ -94,8 +94,8 @@ apt-get dist-upgrade | |||
| 94 | 94 | ||
| 95 | 95 | # remove old squeeze packages left around (keep eyes open!) | |
| 96 | 96 | apt autoremove && \ | |
| 97 | - | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i *A/ { print $3 }') && \ | |
| 98 | - | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i/ { print $2 }') && \ | |
| 97 | + | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|phpmyadmin' | awk '/^i *A/ { print $3 }') && \ | |
| 98 | + | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner|phpmyadmin' | awk '/^i/ { print $2 }') && \ | |
| 99 | 99 | apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
| 100 | 100 | apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 101 | 101 | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 1 deletion
stretch2buster.sh
| @@ -94,7 +94,6 @@ apt-get dist-upgrade | |||
| 94 | 94 | ||
| 95 | 95 | # remove old squeeze packages left around (keep eyes open!) | |
| 96 | 96 | apt autoremove && \ | |
| 97 | - | apt purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') && \ | |
| 98 | 97 | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i *A/ { print $3 }') && \ | |
| 99 | 98 | apt purge $(aptitude search ?obsolete | grep -v -E 'linux-image|mailscanner' | awk '/^i/ { print $2 }') && \ | |
| 100 | 99 | apt purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') && \ | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 4 insertions, 4 deletions
stretch2buster.sh
| @@ -70,6 +70,10 @@ sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |||
| 70 | 70 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 71 | 71 | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| 72 | 72 | ||
| 73 | + | # Fix our ssh pub key package configuration | |
| 74 | + | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 75 | + | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 76 | + | ||
| 73 | 77 | # migrate unattended-upgrades config | |
| 74 | 78 | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 75 | 79 | MAIL=$(grep ^Unattended-Upgrade::Mail /etc/apt/apt.conf.d/50unattended-upgrades | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
| @@ -79,10 +83,6 @@ sed -i 's#//Unattended-Upgrade::Remove-Unused-Dependencies "false"#Unattended-Up | |||
| 79 | 83 | sed -i 's#//Unattended-Upgrade::Automatic-Reboot "false"#Unattended-Upgrade::Automatic-Reboot "true"#' /tmp/50unattended-upgrades && \ | |
| 80 | 84 | /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades | |
| 81 | 85 | ||
| 82 | - | # Fix our ssh pub key package configuration | |
| 83 | - | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 84 | - | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 85 | - | ||
| 86 | 86 | ## phpmyadmin | |
| 87 | 87 | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 88 | 88 | else CFG=/etc/phpmyadmin/config.inc.php; fi | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 5 insertions
stretch2buster.sh
| @@ -61,6 +61,11 @@ EOF | |||
| 61 | 61 | # minimal system upgrade | |
| 62 | 62 | aptitude upgrade | |
| 63 | 63 | ||
| 64 | + | # randomize crontab | |
| 65 | + | if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
| 66 | + | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 67 | + | sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 68 | + | ||
| 64 | 69 | # chrony update | |
| 65 | 70 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 66 | 71 | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
Jan Wagner zrewidował ten Gist 6 years ago. Przejdź do rewizji
1 file changed, 2 insertions, 1 deletion
stretch2buster.sh
| @@ -55,7 +55,8 @@ EOF | |||
| 55 | 55 | /usr/bin/debconf-set-selections /tmp/stretch.preseed | |
| 56 | 56 | ||
| 57 | 57 | # update aptitude first | |
| 58 | - | [ "$(which aptitude)" = "/usr/bin/aptitude" ] && aptitude install aptitude | |
| 58 | + | [ "$(which aptitude)" = "/usr/bin/aptitude" ] && aptitude install aptitude && \ | |
| 59 | + | [ "$(which apt)" = "/usr/bin/apt" ] && apt install apt | |
| 59 | 60 | ||
| 60 | 61 | # minimal system upgrade | |
| 61 | 62 | aptitude upgrade | |
Jan Wagner zrewidował ten Gist 7 years ago. Przejdź do rewizji
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -96,7 +96,7 @@ apt purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') && \ | |||
| 96 | 96 | apt purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') && \ | |
| 97 | 97 | 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 }') && \ | |
| 98 | 98 | apt purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 99 | - | apt purge $(dpkg -l | grep -E 'deb9|stretch' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') && \ | |
| 99 | + | apt purge $(dpkg -l | grep -E 'deb9|stretch' | grep -v xen | grep -v -E 'linux-image|debian-security-support|icinga2' | awk '{ print $2 }') && \ | |
| 100 | 100 | apt -y install deborphan && apt purge $(deborphan | grep -v xen | grep -v -E 'libpam-cracklib|libapache2-mpm-itk') | |
| 101 | 101 | apt purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 102 | 102 | ||