diff options
author | uvok cheetah | 2024-09-09 20:56:18 +0200 |
---|---|---|
committer | uvok cheetah | 2024-09-09 20:56:18 +0200 |
commit | 3684f7d07d327d506a32f093a2d073fd8416b34c (patch) | |
tree | 4d4b7ccf8f988d5b28fc3446622f9337e16d9462 /custom | |
parent | b01d0123187966bc3028bbdfb9e8ef2623a7a813 (diff) |
Set dropbear symlink
Diffstat (limited to 'custom')
-rwxr-xr-x | custom/overlay/etc/init.d/S49-dropbear-prep | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/custom/overlay/etc/init.d/S49-dropbear-prep b/custom/overlay/etc/init.d/S49-dropbear-prep index 33bad8f..7cc5ed6 100755 --- a/custom/overlay/etc/init.d/S49-dropbear-prep +++ b/custom/overlay/etc/init.d/S49-dropbear-prep @@ -4,11 +4,9 @@ # Assumes there's a third partition (test for it). # Assume partition is formatted (however you want). # -# TODO: -# Actually create the dropbear symlink if keys already -# exist in /data/dropbear/ # +set -eu start() { if ! [[ -e /data/ ]] ; then @@ -18,6 +16,11 @@ start() { if test -e /dev/mmcblk0p3 && ! grep -sq mmcblk0p3 /proc/mounts ; then mount /dev/mmcblk0p3 /data/ fi + + if grep -sq mmcblk0p3 /proc/mounts && test -d /data/dropbear ; then + rmdir /etc/dropbear || mv /etc/dropbear /etc/dropbear.bak + ln -snf /data/dropbear /etc/dropbear + fi } case "$1" in |