Skip to content

Instantly share code, notes, and snippets.

@paulresdat
Last active January 22, 2020 07:44
Show Gist options
  • Save paulresdat/f93840b7f5d4c9d63bb440867732ad4a to your computer and use it in GitHub Desktop.
Save paulresdat/f93840b7f5d4c9d63bb440867732ad4a to your computer and use it in GitHub Desktop.
#!/bin/bash
# this is just a quick script I created in bash to install and backup vsts that aren't installable
# ie you have to manually put them into the VST and Components folders, easier to just go the folder via
# the terminal and run this rather than go and find the folder and copy paste over
#/Volumes/LaCie/documents/Keep/VST-MANUAL
#/Library/Audio/Plug-Ins/VST
#/Library/Audio/Plug-Ins/Components
# install vsts
alias fvst="find . -type d -maxdepth 1 | grep -E '(\.component|\.vst)$'"
installvst()
{
printf "\nINSTALLING VSTs\n\n"
count=`fvst | wc -l | sed 's/ //g' | bc`
if [ $count > 0 ]; then
printf "FOUND: $count\n"
fvst
read -n1 -p "Is this correct? [Y/n]: " input
case $input in
Y) printf "\n\nOk... starting install";;
*) printf "\n\nExiting..." ;;
esac
echo ""
if [[ $input == "Y" ]]; then
for i in *; do
if [[ ${i: -4} == ".vst" ]]; then
copyvst "$i"
elif [[ ${i: -10} == ".component" ]]; then
copyau "$i"
fi
done
fi
else
print "None found. Sorry. Go to a directory with .vst or .component directories"
fi;
}
backupvst()
{
printf "\nBACKING UP VSTs\n\n"
count=`fvst | wc -l | sed 's/ //g' | bc`
if [ $count > 0 ]; then
echo "Backing up to /Volumes/LaCie/documents/Keep/VST-MANUAL"
for i in $(fvst | sed 's/^\.\///'); do
# echo "$i"
cp -r "$i" /Volumes/LaCie/documents/Keep/VST-MANUAL
done
else
echo "Nothing found to backup"
fi;
}
# Black 0;30 Dark Gray 1;30
# Red 0;31 Light Red 1;31
# Green 0;32 Light Green 1;32
# Brown/Orange 0;33 Yellow 1;33
# Blue 0;34 Light Blue 1;34
# Purple 0;35 Light Purple 1;35
# Cyan 0;36 Light Cyan 1;36
# Light Gray 0;37 White 1;37
RED='\033[0;31m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
NC='\033[0m'
verifyvst()
{
for i in *; do
if [[ ${i: -4} == ".vst" ]]; then
if [[ -d /Library/Audio/Plug-Ins/VST/$i ]]; then
printf "${CYAN}FOUND: ${i}${NC}\n"
else
printf "${RED}NOT FOUND${NC}: ${i}\n"
fi
elif [[ ${i: -10} == ".component" ]]; then
if [[ -d /Library/Audio/Plug-Ins/Components/$i ]]; then
printf "${CYAN}FOUND: ${i}${NC}\n"
else
printf "${RED}NOT FOUND${NC}: ${i}\n"
fi
fi
done
}
copyvst()
{
for i in "$@"
do
if test -d /Library/Audio/Plug-Ins/VST/"$i"; then
echo-already-found "VST" "$i"
else
echo-copying "$i"
sudo cp -r "$i" /Library/Audio/Plug-Ins/VST/
fi
done
}
echo-already-found()
{
printf "$1 ${YELLOW}'$2'${NC} already found: ${RED}skipping${NC}\n"
}
echo-copying()
{
printf "${CYAN}Copying '$1' to /Library/Audio/Plug-Ins/VST${NC}\n"
}
copyau()
{
for i in "$@"
do
if test -d /Library/Audio/Plug-Ins/Components/"$i"; then
echo-already-found "AU" "$i"
else
echo-copying "$i"
sudo cp -r "$i" /Library/Audio/Plug-Ins/Components/
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment