summaryrefslogtreecommitdiffstats
path: root/projectroot/bin/ipkg_log_wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'projectroot/bin/ipkg_log_wrapper')
-rw-r--r--projectroot/bin/ipkg_log_wrapper19
1 files changed, 19 insertions, 0 deletions
diff --git a/projectroot/bin/ipkg_log_wrapper b/projectroot/bin/ipkg_log_wrapper
new file mode 100644
index 000000000..aac142fca
--- /dev/null
+++ b/projectroot/bin/ipkg_log_wrapper
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# ipkg wrapper - log when installing / removing things
+#
+
+[ -e "/etc/ipkg_log_wrapper.cf" ] && . /etc/ipkg_log_wrapper.cf
+
+FULLARGS="$@"
+IDENT="$(date -R)"
+IPKG=${IPKG:=/usr/bin/ipkg-cl}
+LOGDIR=${LOGDIR:=/var/cache/ipkg}
+LOGFILENAME=${LOGFILENAME:=ipkg_activities.log}
+LOGFILE=$LOGDIR/$LOGFILENAME
+
+[ -e "$LOGDIR" ] || mkdir -p $LOGDIR
+echo -n "$IDENT - $FULLARGS" >> $LOGFILE
+$IPKG $FULLARGS
+echo " ($?)" >> $LOGFILE
+