initial import
This commit is contained in:
23
tor-hardened-preferences/tor-hardened.sh
Normal file
23
tor-hardened-preferences/tor-hardened.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
##############################################
|
||||
# Tor-Hardened Cleaner & Startup Script #
|
||||
##############################################
|
||||
# Clean left over files
|
||||
echo "Cleaning any files left over from a previous run..."
|
||||
rm /srv/torchroot/var/lib/tor/*
|
||||
# Detect old version and upgrade
|
||||
Torchroothash=$(sha256sum /srv/torchroot/usr/bin/tor | awk '{print $1}')
|
||||
Toroutsidehash=$(sha256sum /usr/bin/tor | awk '{print $1}')
|
||||
if [ "$Torchroothash" != "$Toroutsidehash" ]
|
||||
then
|
||||
echo "New version of Tor detected! Updating chroot before running."
|
||||
rm -rf /srv/torchroot
|
||||
wait
|
||||
/bin/sh -c "/usr/libexec/tor-hardened-scripts/torchroot.sh"
|
||||
wait
|
||||
fi
|
||||
|
||||
# Start Tor inside of our chroot
|
||||
echo "Running Tor..."
|
||||
chroot --userspec=tor:tor /srv/torchroot /usr/bin/tor -f /etc/tor/torrc
|
||||
Reference in New Issue
Block a user