Force reboot if online resize was not successful regarding of the distribution

This commit is contained in:
Igor Pecovnik 2016-01-20 09:07:56 +01:00
parent 1b81c4f205
commit 5649a086b6

View file

@ -94,9 +94,9 @@ do_expand_rootfs(){
((echo d; echo $PARTITIONS; echo n; echo p; echo ; echo $STARTFROM; echo ; echo w;) | fdisk $device) >/dev/null || true
s=0
fsck -f $root_partition >/dev/null 2>&1 || true
partprobe $device >/dev/null 2>&1 || true
partprobe $device >/dev/null 2>&1 || s=$?
resize2fs $root_partition >/dev/null 2>&1 || true
if [ "$DISTRIBUTION" == "wheezy" ]; then
if [[ "$DISTRIBUTION" == "wheezy" || "$s" != "0" ]]; then
touch /var/run/reboot
display_alert "Automatic reboot is needed. Please wait"
update-rc.d resize2fs defaults >/dev/null 2>&1