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-11-18 16:05:42 +0300
committernachoparker <nacho@ownyourbits.com>2017-11-19 13:07:07 +0300
commit4328831a760f3d36cd6fb9b8537393feb4641505 (patch)
tree60677a609f3465df6504011477474b0580b7293b
parentede912f8db3503d2681d77cf452108e0c68232f9 (diff)
build: add prepare_sshd
-rw-r--r--buildlib.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildlib.sh b/buildlib.sh
index a1d8b20e..f8eab0c4 100644
--- a/buildlib.sh
+++ b/buildlib.sh
@@ -223,3 +223,15 @@ function deactivate_unattended_upgrades()
sudo umount -l tmpmnt
rmdir tmpmnt &>/dev/null
}
+
+function prepare_sshd()
+{
+ local IMG="$1"
+ local SECTOR1=$( fdisk -l $IMG | grep FAT32 | awk '{ print $2 }' )
+ local OFFSET1=$(( SECTOR1 * 512 ))
+ mkdir -p tmpmnt
+ sudo mount $IMG -o offset=$OFFSET1 tmpmnt
+ sudo touch tmpmnt/ssh # this enables ssh
+ sudo umount tmpmnt
+ rmdir tmpmnt
+}