iopsys-feed/iop/scripts/install_key.sh
Ronny Nilsson d20f43a756 sdk: remove duplicated login prompts. One is enough.
Only one process at a time can read/write the console.
2020-03-05 16:17:58 +01:00

17 lines
703 B
Bash
Executable file

# this is a developer helper script to install the public ssh key in the created image
function install_key {
mkdir -p files/etc/dropbear
test -e ~/.ssh/id_dsa.pub && cat ~/.ssh/id_dsa.pub >>files/etc/dropbear/authorized_keys
test -e ~/.ssh/id_rsa.pub && cat ~/.ssh/id_rsa.pub >>files/etc/dropbear/authorized_keys
chmod 0644 files/etc/dropbear/authorized_keys
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
echo "console::askconsolelate:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
echo Done
}
register_command "install_key" "Install the user's public ssh key in the created image"