summaryrefslogtreecommitdiffstats
path: root/generic/bin/ipkg_log_wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'generic/bin/ipkg_log_wrapper')
-rwxr-xr-xgeneric/bin/ipkg_log_wrapper18
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/bin/ipkg_log_wrapper b/generic/bin/ipkg_log_wrapper
new file mode 100755
index 000000000..e14142e95
--- /dev/null
+++ b/generic/bin/ipkg_log_wrapper
@@ -0,0 +1,18 @@
+#!/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
+