summaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/webbox/Makefile14
-rwxr-xr-xplugins/weblog/procmail/procmail.sh29
2 files changed, 21 insertions, 22 deletions
diff --git a/plugins/webbox/Makefile b/plugins/webbox/Makefile
index 54c954c..5ff22f7 100644
--- a/plugins/webbox/Makefile
+++ b/plugins/webbox/Makefile
@@ -97,14 +97,12 @@ install:
mkdir -p $(DESTDIR)/usr/lib/webserver/plugins
cp $(PROJECTNAME).so $(DESTDIR)/usr/lib/webserver/plugins
- mkdir -p $(DESTDIR)/var/www/webbox
- cp -r html/* $(DESTDIR)/var/www/webbox/
-
- # Minify, conditionally
- command -v uglifyjs && uglifyjs html/webbox.js -m -c > $(DESTDIR)/var/www/webbox/webbox.js || true
- command -v htmlmin && \
- htmlmin html/index.html $(DESTDIR)/var/www/webbox/index.html || true
- command -v cleancss && cleancss -o $(DESTDIR)/var/www/webbox/webbox.css html/webbox.css || true
+ mkdir -p $(DESTDIR)/usr/lib/webbox/html
+ cp -r html/* $(DESTDIR)/usr/lib/webbox/html/
+
+ uglifyjs html/webbox.js -m -c > $(DESTDIR)/usr/lib/webbox/html/webbox.js
+ htmlmin html/index.html $(DESTDIR)/usr/lib/webbox/html/index.html
+ cleancss -o $(DESTDIR)/usr/lib/webbox/html/webbox.css html/webbox.css
# misc ---------------------------------------------------
diff --git a/plugins/weblog/procmail/procmail.sh b/plugins/weblog/procmail/procmail.sh
index bafe889..44fa68f 100755
--- a/plugins/weblog/procmail/procmail.sh
+++ b/plugins/weblog/procmail/procmail.sh
@@ -46,18 +46,6 @@ if echo "$ADDR" | grep -q "weblog-bloginput" ; then
exit 1
fi
-#if grep -q "^pitch " inmail ; then
-# PITCH=`grep "^pitch " inmail|head -n1|sed -e 's/^pitch \([+-]\?[0-9]\+\(\.[0-9]\+\)\?\).*/\1/'`
-# if echo "$PITCH" | grep -q "^pitch " ; then
-# # no pitch match
-# ERRORMSG="Bad pitch syntax."
-# exit 1
-# fi
-# USERLOG="pitch $PITCH"
-#else
-# PITCH=0
-#fi
-
ALLLINES=`wc -l inmail | cut -f1 -d" "`
HEADERLINES=`cat inmail | (n=0; while read i ; do
@@ -77,12 +65,25 @@ echo "$BODY" > /home/weblog-bloginput/body.txt
SUBJECT=`echo "$HEADER" | mimedecode`
SUBJECT_PATH=`echo "$SUBJECT" | sed -e 's/[^a-zA-Z0-9]/_/g'`
-ARTICLEDIR="$BLOGDIR/`date +%Y/%Y%m%d_%H%M`_$SUBJECT_PATH"
+ARTICLEDIR="$BLOGDIR/`date +%Y/%Y%m%d`_$SUBJECT_PATH"
mkdir -p $ARTICLEDIR
echo "Subject: $SUBJECT" >> $ARTICLEDIR/article.data
echo "" >> $ARTICLEDIR/article.data
-echo "$BODY" >> $ARTICLEDIR/article.data
+
+# get attachments
+munpack -C $ARTICLEDIR `pwd`/inmail >/dev/null || true
+
+DATANAME="`ls $ARTICLEDIR/*.desc || true`" 2>/dev/null
+if [ "$DATANAME" = "" ] ; then
+ echo "$BODY" >> $ARTICLEDIR/article.data
+else
+ cat "$DATANAME" >> $ARTICLEDIR/article.data
+ rm "$DATANAME"
+fi
+
+chmod -R a+r $ARTICLEDIR
+chmod a+x $ARTICLEDIR
echo "Processed successfully." | mutt -s "Bloginput: $SUBJECT_PATH" -- "$ADDR" >> ~/log 2>&1