Skip to content

Instantly share code, notes, and snippets.

@crypt0rr
Created January 13, 2022 14:39
Show Gist options
  • Save crypt0rr/d5a3e403a4ff52b7ac2b54bd761b1d39 to your computer and use it in GitHub Desktop.
Save crypt0rr/d5a3e403a4ff52b7ac2b54bd761b1d39 to your computer and use it in GitHub Desktop.
Objective Development Little Snitch - Simple '.lsrules' creating scripts
#!/bin/bash
curl -s https://dbl.oisd.nl/basic -o tmp_out && sed '/#/d' tmp_out > input
echo '{
"description": "",
"name": "",
"rules": [
{
"action": "deny",
"notes": "",
"owner": "me",
"process": "any",
"remote-domains": [' > little-snitch.lsrules
for i in $(cat input); do
echo '"'$i'",' >> little-snitch.lsrules; done
echo "]}
]}" >> little-snitch.lsrules
rm input tmp_out
#!/bin/bash
curl -s https://dbl.oisd.nl/basic -o tmp_out && sed '/#/d' tmp_out > input
echo '{
"description": "",
"name": "",
"rules": [' > little-snitch.lsrules
for i in $(cat input); do
echo ' {
"action": "deny",
"notes": "",
"owner": "me",
"process": "any",
"remote-domains": "'$i'"
},' >> little-snitch.lsrules; done
echo "]}" >> little-snitch.lsrules
rm input tmp_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment