Added support for reading from stdin.
This commit is contained in:
parent
3f1b96e1bb
commit
8b7944dad7
30
ppss
30
ppss
@ -25,7 +25,7 @@ trap 'kill_process' SIGINT
|
|||||||
|
|
||||||
# Setting some vars.
|
# Setting some vars.
|
||||||
SCRIPT_NAME="Distributed Parallel Processing Shell Script"
|
SCRIPT_NAME="Distributed Parallel Processing Shell Script"
|
||||||
SCRIPT_VERSION="2.61"
|
SCRIPT_VERSION="2.62"
|
||||||
|
|
||||||
# The first argument to this script can be a mode.
|
# The first argument to this script can be a mode.
|
||||||
MODES="node start config stop pause continue deploy status erase kill ec2"
|
MODES="node start config stop pause continue deploy status erase kill ec2"
|
||||||
@ -1442,7 +1442,7 @@ get_all_items () {
|
|||||||
then
|
then
|
||||||
log DEBUG "Running as slave, input file has been pushed (hopefully)."
|
log DEBUG "Running as slave, input file has been pushed (hopefully)."
|
||||||
fi
|
fi
|
||||||
if [ ! -e "$INPUT_FILE" ]
|
if [ ! -e "$INPUT_FILE" ] && [ ! "$INPUT_FILE" == "-" ]
|
||||||
then
|
then
|
||||||
log ERROR "Input file $INPUT_FILE does not exist."
|
log ERROR "Input file $INPUT_FILE does not exist."
|
||||||
set_status "ERROR"
|
set_status "ERROR"
|
||||||
@ -1450,15 +1450,27 @@ get_all_items () {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec 10<"$INPUT_FILE"
|
if [ ! "$INPUT_FILE" == "-" ]
|
||||||
|
then
|
||||||
|
|
||||||
while read LINE <&10
|
exec 10<"$INPUT_FILE"
|
||||||
do
|
|
||||||
ARRAY[$count]=$LINE
|
while read LINE <&10
|
||||||
((count++))
|
do
|
||||||
done
|
ARRAY[$count]=$LINE
|
||||||
|
((count++))
|
||||||
|
done
|
||||||
|
|
||||||
|
exec 10>&-
|
||||||
|
else
|
||||||
|
log DEBUG "Reading from stdin.."
|
||||||
|
while read LINE
|
||||||
|
do
|
||||||
|
ARRAY[$count]=$LINE
|
||||||
|
((count++))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
exec 10>&-
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEBUG="$1"
|
DEBUG="$1"
|
||||||
VERSION="2.61"
|
VERSION="2.62"
|
||||||
TMP_DIR="ppss"
|
TMP_DIR="ppss"
|
||||||
PPSS=./ppss
|
PPSS=./ppss
|
||||||
PPSS_DIR=ppss_dir
|
PPSS_DIR=ppss_dir
|
||||||
|
Loading…
Reference in New Issue
Block a user