Created
March 26, 2017 15:50
-
-
Save atika/915d59596cc83f3551767e38e9814153 to your computer and use it in GitHub Desktop.
Generate macOS apps from a list to mount your networks volumes
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
Awesome Volume;afp://macbookpro.local/MyHD | |
Home on MacBookPro;afp://macbookpro.local/macuser | |
DiskStation Video;smb://192.168.0.20/video | |
DiskStation Music;smb://192.168.0.20/music |
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 | |
tmpasfile="mount_drive.applescript" | |
appsDestination="$HOME/Applications/Network Mounter" | |
mkdir "$appsDestination" | |
echo "Generate Apps to ${appsDestination}" | |
while read line; do | |
touch $tmpasfile | |
name=$(echo "$line" | cut -d";" -f1) | |
path=$(echo "$line" | cut -d";" -f2) | |
echo ">> Generate script for ${name}" | |
echo "# Mount script for drive ${name} at path ${path}" > $tmpasfile | |
echo "mount volume \"${path}\"" >> $tmpasfile | |
if [[ -f $tmpasfile ]]; then | |
osacompile -o "${appsDestination}/${name}.app" $tmpasfile | |
fi | |
rm $tmpasfile | |
sleep 1 | |
done < <(cat network_drive.list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment