Megatest

Diff
Login

Differences From Artifact [e5bec056c7]:

To Artifact [625c735179]:


1
2

3
4

5

6
7









8


9
10
11
12





13
14

15
16
17
18

19
20

21
1
2
3
4

5
6
7


8
9
10
11
12
13
14
15
16
17
18
19




20
21
22
23
24
25

26




27
28

29
30


+

-
+

+
-
-
+
+
+
+
+
+
+
+
+

+
+
-
-
-
-
+
+
+
+
+

-
+
-
-
-
-
+

-
+

#!/bin/bash


# Can't always trust $PWD
CURRWD=`pwd`
CURRWD=$(pwd)

# Make sure nbfake host and logfile are set. Fall back to old-style variable names
if [[ $TARGETHOST_LOGF == "" ]]; then
    TARGETHOST_LOGF=NBFAKE-`date +%GWW%V.%u_%T`

if [[ -z "$NBFAKE_HOST" && -n "$TARGETHOST" ]];     then NBFAKE_HOST=$TARGETHOST;     fi

if [[ -z "$NBFAKE_LOG" && -n "$TARGETHOST_LOGF" ]]; then NBFAKE_LOG=$TARGETHOST_LOGF; fi

# Set default nbfake log

if [[ -z "$NBFAKE_LOG" ]]; then
    NBFAKE_LOG=NBFAKE-$(date +%GWW%V.%u_%T)
fi

cat <<__EOF >&2
echo "#======================================================================"
echo "# NBFAKE Logging command to $TARGETHOST_LOGF"
echo "#     \"$*\""
echo "#======================================================================"
#======================================================================
# NBFAKE logging command to: $NBFAKE_LOG
#     $*
#======================================================================
__EOF

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