summaryrefslogtreecommitdiffstats
path: root/generic/bin/ipkg_log_wrapper
blob: e14142e953b1dd62e7e1b6ae994413b6d569a9cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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