diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-09-08 11:18:58 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-09-08 11:19:20 +0300 |
commit | b1c5fa66949620de7756db304aeb2a1f15656f40 (patch) | |
tree | 33a80e999c6756c08c86498d2fff3675d0c30566 /etc/library.sh | |
parent | 82d72e9759a37130519e34b6620b2fae37ae5d38 (diff) |
build devel: deactivate unattended upgrades
Diffstat (limited to 'etc/library.sh')
-rwxr-xr-x | etc/library.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/library.sh b/etc/library.sh index bd45b4f5..6ecb95e6 100755 --- a/etc/library.sh +++ b/etc/library.sh @@ -279,6 +279,22 @@ function copy_to_image() rmdir tmpmnt &>/dev/null } +function deactivate_unattended_upgrades() +{ + local IMG=$1 + local SECTOR + local OFFSET + SECTOR=$( fdisk -l "$IMG" | grep Linux | awk '{ print $2 }' ) + OFFSET=$(( SECTOR * 512 )) + + [ -f "$IMG" ] || { echo "no image"; return 1; } + mkdir -p tmpmnt + sudo mount "$IMG" -o offset="$OFFSET" tmpmnt || return 1 + rm -f tmpmnt/etc/apt/apt.conf.d/20nextcloudpi-upgrades + sudo umount -l tmpmnt + rmdir tmpmnt &>/dev/null +} + function download_resize_raspbian_img() { local SIZE=$1 |