campus-total-block/load-dstdomain-list-into-bl.sh
2024-02-12 01:53:41 +02:00

16 lines
375 B
Bash
Executable File

#!/usr/bin/env bash
LIST_FILENAME="$1"
if [ ! -f "${LIST_FILENAME}" ]
then
echo "The file [ \"${LIST_FILENAME}\" ] doesn't exits"
exit 1
fi
stat load-domains-list.sql && rm -vf load-domains-list.sql
cat load-domains-list.sql.in |sed -e "s@###FILENAME###@${LIST_FILENAME}@g" > load-domains-list.sql
mariadb -u root --local-infile < load-domains-list.sql