classic-reset 313 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/bin/sh

set -eu

ROOT=$SNAP_COMMON/classic

if [ "$(id -u)" != "0" ]; then
    echo "needs to run as root"
    exit 1
fi

for d in /home /run /proc /sys /dev /var/lib/extrausers /etc/sudoers /etc/sudoers.d /snappy; do
  if mountpoint -q "$ROOT/$d"; then
    umount "$ROOT/$d"
  fi
done

# cleanup
rm -rf $ROOT