Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-09-08 11:18:58 +0300
committernachoparker <nacho@ownyourbits.com>2017-09-08 11:19:20 +0300
commitb1c5fa66949620de7756db304aeb2a1f15656f40 (patch)
tree33a80e999c6756c08c86498d2fff3675d0c30566 /etc/library.sh
parent82d72e9759a37130519e34b6620b2fae37ae5d38 (diff)
build devel: deactivate unattended upgrades
Diffstat (limited to 'etc/library.sh')
-rwxr-xr-xetc/library.sh16
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