mirror of
https://github.com/suiryc/archlinux-initrd-ssh-cryptsetup.git
synced 2025-07-27 14:13:52 +03:00
Handle optional ipconfig timeout
Specify timeout for ipconfig so that we can still boot while network is done. Otherwise ipconfig remains stuck (until IP can be configured). If not given we default to 10s. Minor code refactoring. Moved configuration file from /etc/dropbear/initrd.env to /etc/initcpio/sshcs_env since it now contains options for ipconfig and not only dropbear. Package installation script move legacy file to new path if present. v0.3-1
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
post_install() {
|
||||
local sshcs_env="/etc/initcpio/sshcs_env"
|
||||
local sshcs_env_old="/etc/dropbear/initrd.env"
|
||||
local dropbear_authorized_keys="/etc/dropbear/initrd.authorized_keys"
|
||||
local etc_dropbear=$(dirname "${dropbear_authorized_keys}")
|
||||
[ ! -e "${sshcs_env}" ] && [ -e "${sshcs_env_old}" ] && {
|
||||
[ -d $(dirname "${sshcs_env}") ] || mkdir -p $(dirname "${sshcs_env}")
|
||||
mv "${sshcs_env_old}" "${sshcs_env}"
|
||||
cat <<EOF
|
||||
Moved legacy file ${sshcs_env_old} to new path ${sshcs_env}"
|
||||
EOF
|
||||
}
|
||||
[ -d "${etc_dropbear}" ] || mkdir -p "${etc_dropbear}"
|
||||
[ -e "${dropbear_authorized_keys}" ] || touch "${dropbear_authorized_keys}"
|
||||
chmod 600 "${dropbear_authorized_keys}"
|
||||
|
Reference in New Issue
Block a user