0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-01 09:36:14 +00:00
iptv/tools/find-in-all.sh
AnthonyAxenov 1a2bc188c6
Some new stuff
- MIT License
- new make-pls.sh
- some tools refactoring and documentation
2022-06-09 11:51:25 +08:00

25 lines
816 B
Bash
Executable File

#!/bin/bash
#################################################
#
# IPTV channel finder (all playlists)
#
# Usage:
# ./download-all.sh
# ./find-in-all.sh "(disney|atv)"
#
# 1st argument is channel name pattern.
#
# Anthony Axenov (c) 2022
# The MIT License:
# https://github.com/anthonyaxenov/iptv/blob/master/LICENSE
#
#################################################
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
[ ! -d ./downloaded ] && echo "Error: ./downloaded directory does not exist. Run $SCRIPT_DIR/tools/download-all.sh" && exit 1
[ ! "$(ls -A ./downloaded)" ] && echo "Error: ./downloaded directory is empty. Run $SCRIPT_DIR/tools/download-all.sh" && exit 2
for file in ./downloaded/*; do
"$SCRIPT_DIR"/find-in-pls.sh "$1" "$file"
done