Created
February 9, 2013 03:56
-
-
Save davidsth/4743765 to your computer and use it in GitHub Desktop.
File locker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use this to hide your folders | |
# Don't forget to chown : root and chmod : 700 this file | |
# How to use: | |
# filelock [option] filename | |
# option: lock or unlock | |
# Note: when you lock the file, it will be hidden and won't be readable. | |
if [ $1 = "lock" ]; then | |
echo "hiding $2 and locking..." | |
chmod -rx $2 && mv $2 .$2 | |
echo "Done Locking." | |
elif [ $1 = "unlock" ]; then | |
echo "unlocking $2 ..." | |
mv $2 ${2//./} && chmod +rx ${2//./} | |
echo "Done." | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment