mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Add tor-check to CLI (#2412)
* Link tor-check * Add tor-check.sh * Improve code readability * Link tor-check from postinst
This commit is contained in:
@@ -99,6 +99,7 @@ CookieAuthentication 1
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
rm -rf /var/lib/tor/*
|
rm -rf /var/lib/tor/*
|
||||||
|
ln -sf /usr/lib/embassy/scripts/tor-check.sh /usr/bin/tor-check
|
||||||
|
|
||||||
echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-embassy.conf
|
echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-embassy.conf
|
||||||
|
|
||||||
|
|||||||
36
build/lib/scripts/tor-check.sh
Executable file
36
build/lib/scripts/tor-check.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
fail=$(printf " [\033[31m fail \033[0m]")
|
||||||
|
pass=$(printf " [\033[32m pass \033[0m]")
|
||||||
|
|
||||||
|
onion_list=(
|
||||||
|
"Start9|http://privacy34kn4ez3y3nijweec6w4g54i3g54sdv7r5mr6soma3w4begyd.onion"
|
||||||
|
"Mempool|http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion"
|
||||||
|
"DuckDuckGo|https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion"
|
||||||
|
"Brave Search|https://search.brave4u7jddbv7cyviptqjc7jusxh72uik7zt6adtckl5f4nwy2v72qd.onion"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check if ~/.startos/tor-check.list exists and read its contents if available
|
||||||
|
if [ -f ~/.startos/tor-check.list ]; then
|
||||||
|
while IFS= read -r line; do
|
||||||
|
# Check if the line starts with a #
|
||||||
|
if [[ ! "$line" =~ ^# ]]; then
|
||||||
|
onion_list+=("$line")
|
||||||
|
fi
|
||||||
|
done < ~/.startos/tor-check.list
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Testing connection to Onion Pages ..."
|
||||||
|
|
||||||
|
for data in "${onion_list[@]}"; do
|
||||||
|
name="${data%%|*}"
|
||||||
|
url="${data#*|}"
|
||||||
|
if curl --socks5-hostname localhost:9050 "$url" > /dev/null 2>&1; then
|
||||||
|
echo " ${pass}: $name ($url) "
|
||||||
|
else
|
||||||
|
echo " ${fail}: $name ($url) "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Done."
|
||||||
Reference in New Issue
Block a user