36 lines
965 B
Bash
Executable File
36 lines
965 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# openmamba-dw-checklist daily cron script
|
|
# (c) 2008-2009 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
|
#
|
|
. /etc/sysconfig/openmamba-central
|
|
|
|
PIDFILE=/var/run/autodist/autodist.pid
|
|
HOUR=`date +%H`
|
|
|
|
function pid_check() {
|
|
|
|
[ -e $PIDFILE ] && PIDCHECK=`cat $PIDFILE`
|
|
|
|
[ "$PIDCHECK" -a -e /proc/$PIDCHECK ] && {
|
|
echo "Error: an autodist process is already running; exiting for safety."
|
|
exit 0
|
|
|
|
}
|
|
}
|
|
|
|
pid_check
|
|
REPOSITORY=devel-autodist
|
|
openmamba-dw-checklist -h -r $REPOSITORY > $local_ftp/distromatic/$REPOSITORY/_popular.html
|
|
|
|
pid_check
|
|
distromatic -q -t devel-autodist --gensrcpkglist > $local_ftp/$REPOSITORY/srcpkglist
|
|
|
|
pid_check
|
|
su -l autodist -c "autodist -a --server devel-autodist" > $local_ftp/$REPOSITORY/autodist.log
|
|
if [ $? -eq 0 ]; then
|
|
cp $local_ftp/$REPOSITORY/autodist.log $local_ftp/$REPOSITORY/autodist-last.log
|
|
else
|
|
cp $local_ftp/$REPOSITORY/autodist.log $local_ftp/$REPOSITORY/autodist-last-error.log
|
|
fi
|