You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
960 B
30 lines
960 B
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
CHROOTDIR=/opt/nethack/nethack.jerryaldrichiii.com
|
|
|
|
# Copy dgldir on initial run
|
|
if [ ! -d $CHROOTDIR/dgldir/userdata ]; then
|
|
echo "No dgldir detected, copying from image"
|
|
# Need archive here to get original attributes
|
|
cp -a $CHROOTDIR/dgldir.orig/* $CHROOTDIR/dgldir/
|
|
fi
|
|
|
|
# Copy nethack/var on initial run
|
|
if [ ! -d $CHROOTDIR/nethack/var/save ]; then
|
|
echo "No nethack_var detected, copying from image"
|
|
# Need archive here to get original attributes
|
|
cp -a $CHROOTDIR/nethack_var.orig/* $CHROOTDIR/nethack/var
|
|
fi
|
|
|
|
mkdir -p /srv/sshd/host_keys
|
|
if [ ! -f /srv/sshd/host_keys/sshd_host_rsa_key ]; then
|
|
echo "No SSHD host key found at /srv/sshd/host_keys/sshd_host_rsa_key"
|
|
printf "Generating SSHD host key pair"
|
|
ssh-keygen -N '' -t rsa -f /srv/sshd/host_keys/sshd_host_rsa_key
|
|
chmod 400 /srv/sshd/host_keys/sshd_host_rsa_key
|
|
echo "SSHD host key pair generated successfully"
|
|
fi
|
|
|
|
/usr/sbin/sshd -f /srv/sshd/sshd_config -De
|
|
|