Skip to content

Instantly share code, notes, and snippets.

@mo-han
Last active March 21, 2020 08:50
Show Gist options
  • Save mo-han/dff1e13f1fff8b5df0d1c8de57597a53 to your computer and use it in GitHub Desktop.
Save mo-han/dff1e13f1fff8b5df0d1c8de57597a53 to your computer and use it in GitHub Desktop.
create/remove a CACHEDIR.TAG file inside the given directory
#!/bin/bash
curl -L https://gist.githubusercontent.com/mo-han/dff1e13f1fff8b5df0d1c8de57597a53/raw/69c68a0f77a0670f8d6cfa10139b7feb5a30f9f2/tag-cachedir.sh > /usr/local/bin/tagcachedir
chmod +x /usr/local/bin/tagcachedir
curl -L https://gist.githubusercontent.com/mo-han/dff1e13f1fff8b5df0d1c8de57597a53/raw/69ee94866357c69f9716449142580af9d4ea7901/untag-cachedir.sh > /usr/local/bin/untagcachedir
chmod +x /usr/local/bin/untagcachedir
#!/bin/sh
cat <<EOF >"$1"/CACHEDIR.TAG
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by (application name).
# For information about cache directory tags, see:
# http://www.brynosaurus.com/cachedir/
EOF
#!/bin/sh
rm "$1"/CACHEDIR.TAG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment