diff --git a/cleanup-chaos-files.sh b/cleanup-chaos-files.sh deleted file mode 100755 index 4548a2b..0000000 --- a/cleanup-chaos-files.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -# Author: Oliver Ladner -# License: LGPL -# -# Cleans directories from garbage files - -# Where to look -DIR="/mnt/dir1 /mnt/dir2" -# Garbage files (do NOT add desktop.ini/thumbs.db) -# Example to delete every WMV-file: -#HATED_FILES=' -o -iname '*.wmv' ' - -HATED_FILES=' -o -iname '.DS_Store' -o -iname '*.url' ' - -# Locate dirs/files with setUID -#echo -n "Looking for setUID dirs in $DIR..." -#COUNT_SUID=`find $DIR -type d -perm -u=s -print | wc -l` -# -#if [ "$COUNT_SUID" -eq 0 ]; then -# echo " OK, no setUID directories found" -#else -# echo " Found $COUNT_SUID directories" -# echo -n "Doing 'chmod -R u-s'..." -# # Remove the setUID bit -# find $DIR -type d -perm -u=s -exec chmod -R u-s {} \; -# if [ ! "$?" -eq 0 ]; then -# echo " ERROR while chmodding" -# exit 1 -# else -# echo " OK" -# fi -#fi - -# FIXME: add search for dirs/files with weird names -#find $DIR -maxdepth 100 -type d -print | grep '?' - -# Get rid of files like Thumbs.db and desktop.ini, -echo -n "Searching garbage files..." -find $DIR \( -iname 'desktop.ini' -o -iname 'thumbs.db' $HATED_FILES \) -print > /tmp/cleanup.$$ -if [ $? -gt 0 ]; then - exit 1 -fi - -if [ $(grep -v -c '^$' /tmp/cleanup.$$) -eq 0 ]; then - echo " OK, no garbage files found" -else - echo " Found $(grep -v -c '^$' /tmp/cleanup.$$) garbage files" - echo -n "Doing 'rm -f'..." - # Search again and delete the crap - cat /tmp/cleanup.$$ | while read LINE; do - rm "$LINE" - if [ ! "$?" -eq 0 ]; then - echo " ERROR while deleting garbage file $i" - RC=1 - else - RC=0 - fi - done -fi - -rm /tmp/cleanup.$$ -exit $RC diff --git a/varnish_ban.sh b/varnish_ban.sh index f92b2e2..c6b4631 100755 --- a/varnish_ban.sh +++ b/varnish_ban.sh @@ -2,7 +2,7 @@ # Ban (purge) all on localhost # Varnish 4 -varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.http.host ~ $1" +#varnishadm -T localhost:6082 -S /etc/varnish/secret "ban req.http.host ~ $1" # Varnish 5 varnishadm -T localhost:6082 -S /etc/varnish/secret ban req.http.host == $1