#!/bin/bash

# example for test, if remote host is ready

# login daten
HOST="vpserver"
USER="root"


# check existence of host
ping -c1 $HOST &> /dev/null
if test $? -eq 0
then
	# check existence of folder 'marker' in homefolder
        ssh $USER@$HOST 'x=99; y=88; if test  -d ~/marker; then  exit $x; else exit $y; fi' &> /dev/null
        RET=$?
        if test  $RET -eq 99; then
                # host and folder 'marker' exists
                exit 0
        fi
fi

exit 1

