oeps
This commit is contained in:
parent
67ddd04757
commit
ef29f33b86
2 changed files with 50 additions and 0 deletions
41
cvsup/cvsup
Executable file
41
cvsup/cvsup
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
|
||||
# $Id$
|
||||
# $Source$
|
||||
|
||||
die() { echo "$*" >&2; exit 1; }
|
||||
|
||||
export LOCKFILE=${HOME}/.cvsup/$1_lock
|
||||
export DATEFILE=${HOME}/.cvsup/$1_date
|
||||
|
||||
if ( [ -e $LOCKFILE ]); then
|
||||
LOCKPID=`cat $LOCKFILE`
|
||||
if ( ! ps -p $LOCKPID|egrep -q "$LOCKPID" ); then
|
||||
die "Stale lockfile found: $LOCKFILE"
|
||||
else
|
||||
if ( ! [ -z "$PS1" ] ); then
|
||||
echo "already running..."
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
DATE=`perl -e '
|
||||
@time = localtime(time - 14400); # vier uur geleden
|
||||
$time[4]++;
|
||||
$time[5]+=1900;
|
||||
if (length("$time[4]")<2) { $time[4]="0$time[4]"; }
|
||||
if (length("$time[3]")<2) { $time[3]="0$time[3]"; }
|
||||
if (length("$time[2]")<2) { $time[2]="0$time[2]"; }
|
||||
if (length("$time[1]")<2) { $time[1]="0$time[1]"; }
|
||||
if (length("$time[0]")<2) { $time[0]="0$time[0]"; }
|
||||
print "$time[5].$time[4].$time[3].$time[2].$time[1].$time[0]\n";
|
||||
'`
|
||||
|
||||
sed -e "s/\%\%date\%\%/$DATE/" -e "s/\%\%tree\%\%/$1/" -e "s/\%\%branch\%\%/$2/" ${HOME}/.cvsup/sup.tmpl > ${HOME}/.cvsup/$1.sup
|
||||
echo $DATE > $DATEFILE
|
||||
|
||||
echo $$ > $LOCKFILE
|
||||
umask 002
|
||||
/usr/local/bin/cvsup -g -L 2 ${HOME}/.cvsup/$1.sup
|
||||
rm $LOCKFILE
|
||||
Loading…
Add table
Add a link
Reference in a new issue