#!/bin/bash
set -xe
true
id
ls -l
pwd

# create user alice with PW alice
useradd -m --password "$(openssl passwd -1 alice)" alice
# non interactive ssh login
ssh-keygen -t rsa -N "" -f test.key
mkdir -p ~alice/.ssh
chown alice:alice ~alice/.ssh
cp test.key.pub ~alice/.ssh/authorized_keys

mkdir -p ~/.ssh
cat >~/.ssh/config <<-EOF
Host *
   IdentityFile $(pwd)/test.key
   StrictHostKeyChecking accept-new
   PasswordAuthentication no
EOF
# check ssh
ssh alice@localhost true
# check rsync
rsync -av alice@localhost:
# run parsyncfp2 --help
parsyncfp2 --help >/dev/null || true # exits with error code 25 FIXME
du -hs /usr/share
parsyncfp2 --maxload=1000 --np=4 --cs=1M --startdir=/ usr/share alice@localhost:dest/
