updated readme, added make.sh, added peer selector

This commit is contained in:
mrfry 2023-04-10 09:00:24 +02:00
parent e90eb6d3b9
commit 72815d59fb
4 changed files with 175 additions and 56 deletions

30
make.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
scriptPath=$(dirname -- "${0}")
domainPath="${scriptPath}/../../data/domain"
userscriptPath="./user.js"
resultUserscriptPath="./stable.user.js"
domain="${DOMAIN}"
if [ -f "${domainPath}" ]; then
domain=$(cat "${domainPath}")
fi
if [ -z "${domain}" ]; then
echo -e "\033[0;41m${domainPath} does not exist, and DOMAIN is not set!\033[0m"
exit 1
fi
if [ ! -f "${userscriptPath}" ]; then
echo -e "\033[0;41m${userscriptPath} does not exist!\033[0m"
exit 1
fi
userscript=$(cat "${userscriptPath}")
toReplace="[DOMAIN]"
result="${userscript//"$toReplace"/"$domain"}"
echo "$result" > "${resultUserscriptPath}"
echo "Exported with domain: '${domain}' to '${resultUserscriptPath}'"