#!/bin/bash

HOST_TOOLS="$( cd "$( dirname "$0" )" && pwd )"
VEHICLE_TOOLS=/mnt/mmc/LRAUV/Tools

NAMES="tethys daphne makai ono ahi aku opah whoidhs triton pontus galene brizo" 
if [ $# -ne 1 ]; then
  echo "disable-tools-on-vehicle.sh requires a vehicle name as an argument";
  vehicle="_UNDEFINED_";
else
  vehicle=$1
fi

if echo "$NAMES" | grep -q "$vehicle"; then
  echo "disabling LRAUV/Tools scripts on $vehicle";
else
  echo "vehicle name $vehicle invalid";
  echo "valid vehicle names:";
  echo $NAMES;
  exit 0;
fi

## make Tools scripts non-executable 
ssh $vehicle "chmod ugo-x $VEHICLE_TOOLS/*.sh > /dev/null 2>&1"
ssh $vehicle "ls -la $VEHICLE_TOOLS/*"
