mirror of
https://github.com/PDP-10/its.git
synced 2026-01-11 23:53:12 +00:00
34 lines
578 B
Bash
Executable File
34 lines
578 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# At the $HOST, the $USER needs to have an .ssh directory with
|
|
# authorized_keys matching $SECRET.
|
|
|
|
set -e
|
|
|
|
HOST=hactrn.org
|
|
PORT=22
|
|
USER=images
|
|
DIR=/var/www/hactrn.org/images
|
|
|
|
SSH=$HOME/.ssh
|
|
ID=$SSH/id_rsa
|
|
|
|
if test -z "$SECRET"; then
|
|
echo 'ERROR: No key in $SECRET.'
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p $SSH
|
|
chmod 700 $SSH
|
|
echo "$SECRET" > $ID
|
|
chmod 600 $ID
|
|
|
|
ssh-keyscan -p $PORT -H $HOST >> ~/.ssh/known_hosts
|
|
|
|
(cd out; tar czf $EMULATOR.tgz $EMULATOR)
|
|
|
|
echo "Deploying to $USER@$HOST:$PORT"
|
|
rsync -av --inplace -e "ssh -p$PORT -l$USER" out/$EMULATOR.tgz $HOST:$DIR
|
|
|
|
exit 0
|