mirror of
https://github.com/KaringX/karing-ruleset.git
synced 2025-06-08 11:14:14 +08:00
target dir convert
This commit is contained in:
parent
6b664afee7
commit
53693b16a9
@ -3,24 +3,25 @@
|
|||||||
CURRENT_DIR=$(cd $(dirname $0); pwd)
|
CURRENT_DIR=$(cd $(dirname $0); pwd)
|
||||||
|
|
||||||
target_dir=$1
|
target_dir=$1
|
||||||
if [ ! -z "$tar_dir" ]; then
|
if [ -z "$target_dir" ]; then
|
||||||
target_dir=$CURRENT_DIR
|
target_dir=$CURRENT_DIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$target_dir" ]; then
|
if [ ! -d "$target_dir" ]; then
|
||||||
echo "{$target_dir} unkown directory"
|
echo "${target_dir} unkown directory"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd $target_dir
|
cd $target_dir
|
||||||
|
echo "finding<= ${target_dir}"
|
||||||
|
|
||||||
# convert
|
# convert
|
||||||
find . -type f -name "*.json" | while read filename; do
|
find . -type f -name "*.json" | while read filename; do
|
||||||
srs_file=${filename%.json}.srs
|
srs_file=${filename%.json}.srs
|
||||||
echo "source << {$filename}"
|
echo "source << ${filename}"
|
||||||
echo "output >> {$srs_file}"
|
|
||||||
./sing-box rule-set compile $filename -o $srs_file
|
./sing-box rule-set compile $filename -o $srs_file
|
||||||
|
echo -e "output >> ${srs_file}\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
#END FILE
|
#END FILE
|
Loading…
x
Reference in New Issue
Block a user