#!/bin/bash

source /service/sbin/setup

if [ $1 == "init" ]; then 
    echo 127.0.0.1 $(hostname) >> /etc/hosts

    # Keep ssh open so that we can interact with the container
    cat /service/keys/id_rsa.pub >> /root/.ssh/authorized_keys
    /usr/sbin/sshd -D
else
    for f in /service/runscripts/$1/*
    do
	$f $2
    done
fi
