diff --git a/dropbear.service b/dropbear.service new file mode 100644 index 0000000..af0af02 --- /dev/null +++ b/dropbear.service @@ -0,0 +1,11 @@ +[Unit] +Description=Dropbear SSH Daemon +DefaultDependencies=no +Before=cryptsetup.target + +[Service] +Type=simple +ExecStart=/usr/bin/dropbear -F -s -j -k + +[Install] +WantedBy=cryptsetup.target diff --git a/dropbear_install b/dropbear_install index 40a5116..7ef3a75 100644 --- a/dropbear_install +++ b/dropbear_install @@ -92,7 +92,14 @@ build () add_dir "/var/log" touch "${BUILDROOT}"/var/log/lastlog - add_runscript + #systemd enabled + declare -F add_systemd_unit > /dev/null 2>&1 + if [ $? -eq 0 ]; then + add_file "/usr/share/mkinitcpio-dropbear/dropbear.service" "/etc/systemd/system/dropbear.service" + systemctl --root "$BUILDROOT" enable dropbear.service + else + add_runscript + fi } help ()