#!/bin/sh
#
# Prepares dropbear (external keys).
# 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/
#


start() {
	if ! [[ -e /data/ ]] ; then
		mkdir /data/
	fi

	if test -e /dev/mmcblk0p3 && ! grep -sq mmcblk0p3 /proc/mounts ; then
		mount /dev/mmcblk0p3 /data/
	fi
}

case "$1" in
  start)
  	start
	;;
  stop|restart|reload)
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit 0