site nav‎‏‎‎‏‎

categories‎ > ‎code‎ > ‎

k8-abe-poweron

posted 11 Oct 2009 16:30 by Slippy Lane   [ updated 13 Oct 2009 01:54 ]
#!/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 &

Č
ċ
ď
k8-abe-on
(1k)
Slippy Lane,
11 Oct 2009 16:31