docker-debian-repository/scripts/start.sh

23 lines
492 B
Bash
Raw Normal View History

2014-08-12 21:04:26 +00:00
#!/bin/sh
# Many thanks to John Fink <john.fink@gmail.com> for the
# inspiration and to his great work on docker-wordpress'
2014-08-12 22:34:00 +00:00
# let's create a user to SSH into
2014-08-12 21:04:26 +00:00
SSH_USERPASS=`pwgen -c -n -1 8`
mkdir /home/user
useradd -G sudo -d /home/user user
chown user /home/user
2014-08-12 22:34:00 +00:00
echo "user:$SSH_USERPASS" | chpasswd
echo "ssh user password: $SSH_USERPASS"
CRONFILE=`mktemp`
cat > $CRONFILE <<EOF
* * * * * echo "pif" >> /home/user/pif.log
EOF
crontab -u user $CRONFILE
rm -f $CRONFILE
2014-08-12 21:04:26 +00:00
supervisord -n