linuxbox/dockerrun.sh

20 lines
450 B
Bash

#!/bin/bash
if [ ! -d /config/code ]; then
echo "Copying current home directory to config path."
cp -r /home/code /config/
fi
echo "Remapping home directory"
rm -rf /home/code
ln -s /config/home/code /home/code
if [ ! -d /config/ssh ]; then
echo "Copying current ssh directory to config path."
cp -r /etc/ssh /config/
fi
echo "Remapping ssh directory"
rm -rf /etc/ssd
ln -s /config/ssd /etc/ssd
echo "Starting SSH server"
/usr/sbin/sshd -D