Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #96 from atc0005/minor-refresh-of-demo-scripts
Browse files Browse the repository at this point in the history
DEMO | Install latest go, add more reset feedback
  • Loading branch information
atc0005 authored Jul 17, 2020
2 parents 61af085 + c282b75 commit 39da44d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contrib/demo/scripts/02-install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ then
# install Go toolchain
echo "Downloading and installing Go toolchain"
cd /tmp
export GO_VERSION="1.14.4"
export GO_VERSION="1.14.6"
rm -f go1.*.linux-amd64.tar.gz
curl -L -O https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz
sudo tar zxf go${GO_VERSION}.linux-amd64.tar.gz -C /usr/local/
Expand Down
14 changes: 7 additions & 7 deletions contrib/demo/scripts/06-reset-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,42 @@ echo "Run scripts ${script_names} to reset other files also."
# sudo touch /var/log/fail2ban.log
# sudo touch /var/log/mail.log

# Stop services
echo "* Stop services"
sudo systemctl stop fail2ban
sudo systemctl stop postfix
sudo systemctl stop rsyslog
sudo systemctl stop brick

# Truncate log files
echo "* Truncate log files"
sudo truncate -s 0 /var/cache/brick/users.brick-disabled.txt
sudo truncate -s 0 /var/log/brick/users.brick-reported.log
sudo truncate -s 0 /var/log/brick/syslog.log
sudo truncate -s 0 /var/log/fail2ban.log
sudo truncate -s 0 /var/log/mail.log

# Fix permissions
echo "* Fix permissions"
sudo chown -Rv brick:syslog /var/log/brick
sudo chmod -v 664 /var/log/brick/syslog.log
sudo chmod -v 644 /var/log/brick/users.brick-reported.log
sudo chown -Rv brick:brick /var/cache/brick
sudo chmod -v 644 /var/cache/brick/users.brick-disabled.txt

# Clear any stuck emails
echo "* Clear any stuck emails"
sudo postsuper -d ALL

# Reset Docker container
echo "* Reset Docker container"
sudo docker container stop maildev
sudo docker run --rm --detach --name maildev -p 1080:80 -p 1025:25 maildev/maildev

# Reset fail2ban state
echo "* Reset fail2ban state"
# https://unix.stackexchange.com/questions/286119
sudo systemctl stop fail2ban
for lin in {200..1}; do
sudo iptables -D f2b-brick $lin 2>&1 | grep -v 'iptables: No'
done
sudo rm -vf /var/lib/fail2ban/fail2ban.sqlite3

# Restart affected services so that they'll start over fresh
echo "* Restart affected services so that they'll start over fresh"
sudo systemctl restart rsyslog
sudo systemctl restart postfix
sudo systemctl restart fail2ban
Expand Down

0 comments on commit 39da44d

Please sign in to comment.