#!/bin/bash echo "Checking for Abe's presence on the network..." result=`ping -c 1 192.168.2.2 | grep "1 received"` if [ -z "$result" ]; then echo "Switching Abe on..." switchon 0 # sends command to close output 0 on the K8055 interface board switchoff 0 # opens the output switch again. echo "Done. Waiting for network response from Abe..." while [ -z "$result" ]; do result=`ping -c 1 192.168.2.2 | grep "1 received"` done echo "Network response received." else echo "Abe is already powered up." fi echo "Mounting remote drive..." if [ ! -d "/$HOME/abe" ]; then mkdir "/$HOME/abe" fi if [ ! -e "/$HOME/abe/index.html" ]; then sshfs $USER@192.168.2.2:/ /$HOME/abe else echo "Home folder appears to already be mounted." fi echo "Running x2vnc..." x2vnc 192.168.2.2:0 & |