4
# Copyright (C) 2009 Canonical Ltd.
6
# Authors: Dustin Kirkland <kirkland@canonical.com>
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, version 2 of the License.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
19
if echo "$0" | grep -qs "ecryptfs"; then
20
echo "ERROR: This file must be sourced, rather than executed:"
27
# Hacky, umount.ecryptfs_private should be taught to exit 1 on
28
# unsuccessful unmount, must check who else depends on this exit code.
29
if /sbin/umount.ecryptfs_private | grep -v "Sessions still open"; then
32
echo "ERROR: Unable to access .Private, please close some sessions"
34
/sbin/mount.ecryptfs_private