Last change
on this file since 12681 was 10720, checked in by rick, 13 years ago |
Plaats de handige tools in de ... tools directory :-)
|
-
Property svn:executable
set to
*
|
File size:
579 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 | # Back-up ntp.drift file changes to flash.
|
---|
3 |
|
---|
4 | SRC="/var/db/ntp.drift"
|
---|
5 | DST="/cfg/local/ntp.drift"
|
---|
6 |
|
---|
7 | trap "umount /cfg" 1 2 15 EXIT
|
---|
8 |
|
---|
9 | EX_OK=0
|
---|
10 | EX_NOINPUT=66
|
---|
11 | EX_CANTCREAT=73
|
---|
12 |
|
---|
13 | mount -ro noatime /cfg
|
---|
14 |
|
---|
15 | # Check whether source exists
|
---|
16 | if [ ! -r $SRC ]; then
|
---|
17 | echo "ERROR: '$SRC' not readable!" 1>&2
|
---|
18 | exit $EX_NOINPUT
|
---|
19 | fi
|
---|
20 |
|
---|
21 | # Compare files, ignore white spaces, modification, etc
|
---|
22 | diff -b -B -q ${SRC} ${DST}; RETVAL=$?
|
---|
23 | if [ $RETVAL -ne 0 ]; then
|
---|
24 | # 2: DST does not yet, exists, 1: file differs
|
---|
25 | mount -uwo noatime /cfg
|
---|
26 | mkdir -p /cfg/local
|
---|
27 | cp ${SRC} ${DST}
|
---|
28 | fi
|
---|
29 |
|
---|
30 | exit $EX_OK
|
---|
Note:
See
TracBrowser
for help on using the repository browser.