Added install_key to iop

This commit is contained in:
Jonas Höglund 2016-04-13 15:27:09 +02:00
parent d3bf187a66
commit b5b88e6335

18
iop/scripts/install_key.sh Executable file
View file

@ -0,0 +1,18 @@
# 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 "tty/0::askfirst:/bin/ash --login" >>files/etc/inittab
echo "ttyS0::askfirst:/bin/ash --login" >>files/etc/inittab
echo Done
}
register_command "install_key" "Install the user's public ssh key in the created image"