Last active
May 11, 2021 20:52
-
-
Save dade80vr/334cb4d25dee16c7bb217cec83818272 to your computer and use it in GitHub Desktop.
Mac OSX Bash script for quick dot files cleaning on USB/SD and auto eject
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 | |
# DOT files clean script and auto eject | |
printf "Insert your USB/SD volume name (es: SD): " | |
read -r volumename | |
if df | grep -iw "$volumename" > /dev/null | |
then | |
echo "Cleaning dot_files into \"/Volumes/$volumename\" .." | |
sudo dot_clean /Volumes/$volumename | |
echo "Ejecting volume .." | |
sudo diskutil eject /Volumes/$volumename | |
echo "Well done!" | |
exit 0 | |
else | |
echo "No \"/Volumes/$volumename\" found - Exiting.." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment