Source

bin / toch

#!/bin/bash
USR_DIR="$HOME/.config/chromium"
TMP_DIR="/tmp/toch"

rc.d list tor | grep -q STARTED || sudo rc.d start tor || { echo failed to start tor; exit 1; }

if ! [ -d "$TMP_DIR" ]; then
	cp -r "$USR_DIR" "$TMP_DIR"
	rm "$TMP_DIR/Singleton"*
	rm "$TMP_DIR/Default/"*-journal
fi

{
	chromium --incognito --proxy-server="socks://localhost:9050" --user-data-dir="$TMP_DIR" "$@"
	pgrep -lf chromium | grep -q -- --proxy-server &> /dev/null || rm -rf "$TMP_DIR"
} &