456 current 2025-06-28 04:58:50 25.05.20250424.f771eb4 6.12.24 *
This commit is contained in:
@@ -207,6 +207,7 @@ alias wt="systemctl restart NetworkManager"
|
||||
alias syncthing="firefox localhost:8384"
|
||||
alias htop="btop" # of course
|
||||
alias top="btop" # of course
|
||||
alias activecon="nmcli -t -f name connection show --active"
|
||||
|
||||
stack() {
|
||||
find . -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \;
|
||||
|
||||
@@ -1,8 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
websites=("www.reddit.com" "reddit.com" "www.youtube.com" "youtube.com" "www.instagram.com" "instagram.com" "www.facebook.com" "facebook.com" "www.craigslist.org" "craigslist.org" "www.ebay.com" "ebay.com" "www.monkeytype.com" "monkeytype.com" "www.typeracer.com" "typeracer.com" "www.twitter.com" "twitter.com" "www.linkedin.com" "linkedin.com" "tinder.com")
|
||||
blacklist=(
|
||||
"NUWave"
|
||||
)
|
||||
|
||||
should_block=false
|
||||
for ssid in "${blacklist[@]}"; do
|
||||
if [[ "$CONNECTION_ID" == "$ssid" ]]; then
|
||||
should_block=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
$should_block || exit 0
|
||||
|
||||
websites=("www.reddit.com" "www.youtube.com" "www.instagram.com" "www.facebook.com" "facebook.com" "www.craigslist.org" "www.ebay.com" "www.monkeytype.com" "www.typeracer.com" "www.twitter.com" "www.linkedin.com")
|
||||
|
||||
op=""
|
||||
if [ "$2" == "up" ]; then
|
||||
op="on"
|
||||
elif ["$2" == "pre-down" ]; then
|
||||
op="off"
|
||||
else
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
for website in ${websites[@]}; do
|
||||
grep -v "$website" /etc/hosts > "$tempHosts"
|
||||
mv "$tempHosts" /etc/hosts
|
||||
sh /etc/profiles/per-user/synchronous/bin/dnsblock-norestart "$op" "$website"
|
||||
# grep -v "$website" /etc/hosts > "$tempHosts"
|
||||
# mv "$tempHosts" /etc/hosts
|
||||
done
|
||||
|
||||
sudo systemctl restart dnsmasq
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
# dispatcherScripts = [
|
||||
# {
|
||||
# source = ./blockers.sh;
|
||||
# type = "basic";
|
||||
# }
|
||||
# ];
|
||||
dispatcherScripts = [
|
||||
{
|
||||
source = ./blockers.sh;
|
||||
type = "basic";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# interfaces = {
|
||||
|
||||
Reference in New Issue
Block a user