Commit Graph

7 Commits

Author SHA1 Message Date
Tianon Gravi 52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00
Jess Frazelle 026b710879
change sh to bash for shopt
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-27 12:16:40 -08:00
Bruno Tavares 5f98b97749 Nuke when graphdir is a mount
Previously, when the graphdir was a root of a mountpoint, we would not
be able to cleanup the graphdir, as the script would umount in case
target dir is a mount itself

```/etc/mtab
/dev/xvdc1 /var/lib/docker btrfs
```

When running the script, the graphdir would be unmounted and it would
remove a (possibly) empty folder.

```
Nuking /var/lib/docker ...
  (if this is wrong, press Ctrl+C NOW!)

  + sleep 10

  + umount -f /var/lib/docker
  + rm -rf /var/lib/docker
  ```

This PR includes the necessary changes to nuke the folder on this
scenario, including when the graphdir is a btrfs mount iself.

Signed-off-by: Bruno Tavares <btavare@thoughtworks.com>
2016-11-01 22:22:25 -02:00
Adam Mills c3aa75c5a7 nuke-graph-directory.sh: Improve subvolume search
This change allows btrfs subvolumes to be found in additional system
configurations. The old logic failed to correctly identify subvolumes
when the root fs was mounted as a subvolume that was not the btrfs
filesystem root.

Signed-off-by: Adam Mills <adam@armills.info>
2016-08-08 13:00:21 -04:00
Joe Ferguson d2e9f6c0c1 Fix nuke script to remove from end of path
Signed-off-by: Joe Ferguson <joe@infosiftr.com>
2015-09-09 15:34:05 -07:00
Tianon Gravi 6b340e391c Fix a bashism and some minor bugs in nuke-graph-directory.sh
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-12-12 11:51:12 -07:00
Tianon Gravi 047ce47d92 Add contrib/nuke-graph-directory.sh script to clean out old /var/lib/docker directories much more easily
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-08-05 12:36:39 -06:00