mirror of
https://github.com/KaringX/karing-ruleset.git
synced 2025-06-11 09:44:14 +08:00
26 lines
441 B
Bash
Executable File
26 lines
441 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CURRENT_DIR=$(cd $(dirname $0); pwd)
|
|
|
|
target_dir=$1
|
|
if [ ! -z "$tar_dir" ]; then
|
|
target_dir=$CURRENT_DIR
|
|
fi
|
|
|
|
if [ ! -d "$target_dir" ]; then
|
|
echo "{$target_dir} unkown directory"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
cd $target_dir
|
|
|
|
# convert
|
|
find . -type f -name "*.json" | while read filename; do
|
|
srs_file=${filename%.json}.srs
|
|
echo $filename
|
|
echo $srs_file
|
|
./sing-box rule-set compile $filename -o $srs_file
|
|
done
|
|
|
|
#END FILE |