Skip to content

Commit

Permalink
nbd: backup and recover curvetab
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-hanqing authored and ilixiaocui committed Aug 6, 2021
1 parent 510ffbc commit 035c434
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nbd/nbd-package/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ chmod +x /usr/bin/map_curve_disk.sh
cp /usr/bin/map_curve_disk.sh /etc/init.d
update-rc.d map_curve_disk.sh defaults

CURVETAB=/etc/curve/curvetab
CURVETABBAK=/etc/curve/curvetab-bak

if [ -f ${CURVETABBAK} ]; then
cp -f -p ${CURVETABBAK} ${CURVETAB}
rm -f ${CURVETABBAK}
fi

exit 0
12 changes: 12 additions & 0 deletions nbd/nbd-package/DEBIAN/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

CURVETAB=/etc/curve/curvetab
CURVETABBAK=/etc/curve/curvetab-bak

if [ -f ${CURVETAB} ]; then
cp -f -p ${CURVETAB} ${CURVETABBAK}
fi

exit 0

0 comments on commit 035c434

Please sign in to comment.