aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/postinst8
1 files changed, 4 insertions, 4 deletions
diff --git a/debian/postinst b/debian/postinst
index 0008ec4..31b430c 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -11,9 +11,9 @@ export ORGFILE="/usr/share/initramfs-tools/scripts/local-top/cryptroot"
export DIVFILE="/usr/share/naskpass/cryptroot.orig"
export BCKFILE="/var/backup/cryptroot.naskpass"
+
case "$1" in
install)
- rm -f ${BCKFILE}
mkdir -p /usr/share/naskpass
if [ ! -f ${ORGFILE} ]; then
whiptail --title "Missing file" --msgbox "/usr/share/initramfs-tools/scripts/local-top/cryptroot is missing!\nabort .." 9 70
@@ -40,11 +40,11 @@ case "$1" in
0)
if [ ${active} -eq 0 ]; then
echo "Activating naskpass .." >&2
- dpkg-divert --package naskpass --divert ${DIVFILE} --rename --add ${ORGFILE}
- mv ${BCKFILE} ${ORGFILE}
+ dpkg-divert --package naskpass --divert ${DIVFILE} --rename --add ${ORGFILE} || true
+ mv ${BCKFILE} ${ORGFILE} 2>/dev/null || true
elif [ ${active} -eq 1 ]; then
echo "Deactivating naskpass .." >&2
- mv ${ORGFILE} ${BCKFILE}
+ mv ${ORGFILE} ${BCKFILE} 2>/dev/null || true
dpkg-divert --package naskpass --remove --rename ${ORGFILE} || true
else
echo "Doin' nothing .." >&2