Megatest

nbfake at [fa535bcd4c]
Login

File utils/nbfake artifact 6962f03891 part of check-in fa535bcd4c


#!/bin/bash

# Can't always trust $PWD
CURRWD=`pwd`
if [[ $TARGETHOST_LOGF == "" ]]; then
    TARGETHOST_LOGF=NBFAKE-`date +%GWW%V.%u_%T`
fi
echo "#======================================================================"
echo "# NBFAKE Running command:"
echo "#     \"$*\""
echo "#======================================================================"

if [[ $TARGETHOST == ""  ]]; then
  sh -c "cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &"
else
  ssh -n -f $TARGETHOST "sh -c \"cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &\""
fi