show line number if bad skylink is found
This commit is contained in:
parent
fd404fa2ea
commit
5a203a9583
|
@ -14,13 +14,15 @@ skylinks=()
|
||||||
if test -f "$1"; then
|
if test -f "$1"; then
|
||||||
OLDIFS=$IFS
|
OLDIFS=$IFS
|
||||||
IFS=','
|
IFS=','
|
||||||
|
line_number=1
|
||||||
while read line
|
while read line
|
||||||
do
|
do
|
||||||
if [[ $line =~ ([a-zA-Z0-9_-]{46}) ]]; then
|
if [[ $line =~ ([a-zA-Z0-9_-]{46}) ]]; then
|
||||||
skylinks+=("$BASH_REMATCH")
|
skylinks+=("$BASH_REMATCH")
|
||||||
else
|
else
|
||||||
echo "Incorrect skylink: $line" && exit 1
|
echo "Incorrect skylink at line ${line_number}: $line" && exit 1
|
||||||
fi
|
fi
|
||||||
|
let line_number+=1
|
||||||
done < $1;
|
done < $1;
|
||||||
IFS=$OLDIFS
|
IFS=$OLDIFS
|
||||||
else
|
else
|
||||||
|
|
Reference in New Issue