mirror of
https://github.com/raynormast/fake-firehose.git
synced 2024-12-21 23:33:14 +00:00
Initital commit, need to merge
This commit is contained in:
parent
dcc2a551d2
commit
8616545d0c
1 changed files with 21 additions and 0 deletions
21
scripts/import-from-json.sh
Executable file
21
scripts/import-from-json.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
## The file you want to import
|
||||
file=$1
|
||||
base=`basename "$file"`
|
||||
|
||||
if [[ ! -f "$file" ]]
|
||||
then
|
||||
echo "[WARN] File not found, exiting, $file"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
cat "$file" |grep "data: " | while read -r line
|
||||
do
|
||||
if [[ $line == *"uri"* ]]
|
||||
then
|
||||
echo $line |sed 's/data://g'| jq .uri| sed 's/\"//g' >> "./$base.uris.txt" &
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
## Exit 0 by default
|
||||
exit 0
|
Loading…
Reference in a new issue