File: revert.sh

package info (click to toggle)
samba 2.2.3a-15
  • links: PTS
  • area: main
  • in suites: woody
  • size: 24,336 kB
  • ctags: 19,246
  • sloc: ansic: 179,555; sh: 6,888; perl: 2,091; makefile: 1,491; awk: 1,143; exp: 1,143; csh: 161
file content (18 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
BINDIR=$1
shift

for p in $*; do
 p2=`basename $p`
 if [ -f $BINDIR/$p2.old ]; then
   echo Restoring $BINDIR/$p2.old
   mv $BINDIR/$p2 $BINDIR/$p2.new
   mv $BINDIR/$p2.old $BINDIR/$p2
   rm -f $BINDIR/$p2.new
 else
   echo Not restoring $p
 fi
done

exit 0