Artifact
5637253c81cc7aff9bc28bbe7ae7022d88b63473:
0000: 23 21 2f 62 69 6e 2f 62 61 73 68 0a 23 23 23 23 #!/bin/bash.####
0010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0020: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0030: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0040: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0050: 23 23 23 23 23 23 23 23 23 23 23 0a 23 0a 23 20 ###########.#.#
0060: 72 65 6d 72 75 6e 20 2d 20 73 61 6d 65 20 62 65 remrun - same be
0070: 68 61 76 69 6f 72 20 61 73 20 6e 62 66 61 6b 65 havior as nbfake
0080: 20 62 75 74 20 66 69 72 73 74 20 70 61 72 61 6d but first param
0090: 20 69 73 20 61 20 68 6f 73 74 68 61 6e 65 0a 23 is a hosthane.#
00a0: 20 20 20 20 20 20 20 20 20 20 28 63 61 70 74 75 (captu
00b0: 72 65 20 63 6f 6d 6d 61 6e 64 20 6f 75 74 70 75 re command outpu
00c0: 74 20 69 6e 20 61 20 6c 6f 67 66 69 6c 65 29 0a t in a logfile).
00d0: 23 0a 23 20 72 65 6d 72 75 6e 20 62 65 68 61 76 #.# remrun behav
00e0: 69 6f 72 20 63 61 6e 20 62 65 20 63 68 61 6e 67 ior can be chang
00f0: 65 64 20 62 79 20 73 65 74 74 69 6e 67 20 74 68 ed by setting th
0100: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 6e 76 20 e following env
0110: 76 61 72 3a 0a 23 20 20 20 4e 42 46 41 4b 45 5f var:.# NBFAKE_
0120: 4c 4f 47 20 20 20 20 20 20 20 20 4c 6f 67 66 69 LOG Logfi
0130: 6c 65 20 66 6f 72 20 6e 62 66 61 6b 65 20 6f 75 le for nbfake ou
0140: 74 70 75 74 0a 23 0a 23 23 23 23 23 23 23 23 23 tput.#.#########
0150: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0160: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0170: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0180: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################
0190: 23 23 23 23 23 23 0a 23 0a 23 20 54 68 69 73 20 ######.#.# This
01a0: 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 file is part of
01b0: 4d 65 67 61 74 65 73 74 2e 0a 23 20 0a 23 20 20 Megatest..# .#
01c0: 20 20 20 4d 65 67 61 74 65 73 74 20 69 73 20 66 Megatest is f
01d0: 72 65 65 20 73 6f 66 74 77 61 72 65 3a 20 79 6f ree software: yo
01e0: 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 u can redistribu
01f0: 74 65 20 69 74 20 61 6e 64 2f 6f 72 20 6d 6f 64 te it and/or mod
0200: 69 66 79 0a 23 20 20 20 20 20 69 74 20 75 6e 64 ify.# it und
0210: 65 72 20 74 68 65 20 74 65 72 6d 73 20 6f 66 20 er the terms of
0220: 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 the GNU General
0230: 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 61 Public License a
0240: 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0a 23 s published by.#
0250: 20 20 20 20 20 74 68 65 20 46 72 65 65 20 53 6f the Free So
0260: 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f ftware Foundatio
0270: 6e 2c 20 65 69 74 68 65 72 20 76 65 72 73 69 6f n, either versio
0280: 6e 20 33 20 6f 66 20 74 68 65 20 4c 69 63 65 6e n 3 of the Licen
0290: 73 65 2c 20 6f 72 0a 23 20 20 20 20 20 28 61 74 se, or.# (at
02a0: 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 20 61 6e your option) an
02b0: 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e 2e y later version.
02c0: 0a 23 20 0a 23 20 20 20 20 20 4d 65 67 61 74 65 .# .# Megate
02d0: 73 74 20 69 73 20 64 69 73 74 72 69 62 75 74 65 st is distribute
02e0: 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 68 d in the hope th
02f0: 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 at it will be us
0300: 65 66 75 6c 2c 0a 23 20 20 20 20 20 62 75 74 20 eful,.# but
0310: 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 WITHOUT ANY WARR
0320: 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 ANTY; without ev
0330: 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 en the implied w
0340: 61 72 72 61 6e 74 79 20 6f 66 0a 23 20 20 20 20 arranty of.#
0350: 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 MERCHANTABILITY
0360: 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 or FITNESS FOR
0370: 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 A PARTICULAR PUR
0380: 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0a 23 POSE. See the.#
0390: 20 20 20 20 20 47 4e 55 20 47 65 6e 65 72 61 6c GNU General
03a0: 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 Public License
03b0: 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 for more details
03c0: 2e 0a 23 20 0a 23 20 20 20 20 20 59 6f 75 20 73 ..# .# You s
03d0: 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 hould have recei
03e0: 76 65 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 ved a copy of th
03f0: 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 e GNU General Pu
0400: 62 6c 69 63 20 4c 69 63 65 6e 73 65 0a 23 20 20 blic License.#
0410: 20 20 20 61 6c 6f 6e 67 20 77 69 74 68 20 4d 65 along with Me
0420: 67 61 74 65 73 74 2e 20 20 49 66 20 6e 6f 74 2c gatest. If not,
0430: 20 73 65 65 20 3c 68 74 74 70 3a 2f 2f 77 77 77 see <http://www
0440: 2e 67 6e 75 2e 6f 72 67 2f 6c 69 63 65 6e 73 65 .gnu.org/license
0450: 73 2f 3e 2e 0a 0a 69 66 20 5b 5b 20 2d 7a 20 22 s/>...if [[ -z "
0460: 24 40 22 20 5d 5d 3b 20 74 68 65 6e 0a 20 20 63 $@" ]]; then. c
0470: 61 74 20 3c 3c 5f 5f 45 4f 46 0a 0a 72 65 6d 72 at <<__EOF..remr
0480: 75 6e 20 75 73 61 67 65 3a 0a 0a 72 65 6d 72 75 un usage:..remru
0490: 6e 20 68 6f 73 74 6e 61 6d 65 20 3c 63 6f 6d 6d n hostname <comm
04a0: 61 6e 64 20 74 6f 20 72 75 6e 3e 0a 0a 72 65 6d and to run>..rem
04b0: 72 75 6e 20 62 65 68 61 76 69 6f 72 20 63 61 6e run behavior can
04c0: 20 62 65 20 63 68 61 6e 67 65 64 20 62 79 20 73 be changed by s
04d0: 65 74 74 69 6e 67 20 74 68 65 20 66 6f 6c 6c 6f etting the follo
04e0: 77 69 6e 67 20 65 6e 76 20 76 61 72 73 3a 0a 20 wing env vars:.
04f0: 20 20 4e 42 46 41 4b 45 5f 4c 4f 47 20 20 20 20 NBFAKE_LOG
0500: 20 20 20 20 4c 6f 67 66 69 6c 65 20 66 6f 72 20 Logfile for
0510: 72 65 6d 72 75 6e 20 6f 75 74 70 75 74 0a 0a 5f remrun output.._
0520: 5f 45 4f 46 0a 20 20 65 78 69 74 0a 66 69 0a 0a _EOF. exit.fi..
0530: 65 78 70 6f 72 74 20 4e 42 46 41 4b 45 5f 48 4f export NBFAKE_HO
0540: 53 54 3d 24 31 0a 73 68 69 66 74 0a 65 78 65 63 ST=$1.shift.exec
0550: 20 6e 62 66 61 6b 65 20 24 2a 0a nbfake $*.