summaryrefslogtreecommitdiff
path: root/localwebresolve
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2011-03-15 13:39:58 +0100
committerJonas Smedegaard <dr@jones.dk>2011-03-15 13:39:58 +0100
commitd3b2f6fcf263f0a460ab5e0083f0eac9742a0626 (patch)
tree503472f21ad48d92ab6c14098db231697eb32f5d /localwebresolve
parentbe3ef2bc15658e792e7294324078290008743699 (diff)
Fix bashisms: superfluous leading function keyword. Thanks to 'themill'.
Diffstat (limited to 'localwebresolve')
-rwxr-xr-xlocalwebresolve14
1 files changed, 7 insertions, 7 deletions
diff --git a/localwebresolve b/localwebresolve
index a8252a9..ab11981 100755
--- a/localwebresolve
+++ b/localwebresolve
@@ -13,13 +13,13 @@
set -e
-function usage() {
+usage() {
echo "Usage: $(basename $0) <YYYY.MM> [<website> [<website>...]]"
echo " If no website is given, all are attempted"
exit 1
}
-function exit1() {
+exit1() {
echo "Error: $1"
echo "Exiting..."
exit 1
@@ -43,11 +43,11 @@ LOGROOT=/var/log/apache-vhosts
WEBROOT=/var/www
# Options: $1=LOGROOT, $2=WEBROOT, $3=WEBSITE, $4=YEARDOTMONTH
-function resolveddir() { echo $1/$3; }
-function webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; }
-#function logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); }
-function logcontent() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; }
-function logremove() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; }
+resolveddir() { echo $1/$3; }
+webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; }
+#logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); }
+logcontent() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do zcat $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do cat $file; done; }
+logremove() { for file in $(find $1/$3 -name "$YEARDOTMONTH.??.gz" ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; for file in $(find $1/$3 -name "$YEARDOTMONTH.??" ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow | sort); do rm -f $file; done; }
# The above can be overridden
LOCALCONFIG=/etc/local/webresolve.conf