#!/bin/bash
bash -c if [ system_profiler SPAirPortDataType | grep theprinceandthepauper: ] = theprinceandthepauper;
then
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl load -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to princeandpauper sharings settings"
elif [ system_profiler SPAirPortDataType | grep eduroam: ] = eduroam;
then
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to eduroam and settings applied"
else
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to unknown"
fi
im getting an error everytime i run this. Some silly syntax cant figure out what it is?
[: -c: line 1: syntax error: unexpected end of file
grep: ]: No such file or directory
grep: =: No such file or directory
grep: theprinceandthepauper: No such file or directory
homesharing.sh: line 4: syntax error near unexpected token `then'
homesharing.sh: line 4: ` then'
bash -c if [ system_profiler SPAirPortDataType | grep theprinceandthepauper: ] = theprinceandthepauper;
then
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl load -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to princeandpauper sharings settings"
elif [ system_profiler SPAirPortDataType | grep eduroam: ] = eduroam;
then
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to eduroam and settings applied"
else
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist;
sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist;
echo "connected to unknown"
fi
im getting an error everytime i run this. Some silly syntax cant figure out what it is?
[: -c: line 1: syntax error: unexpected end of file
grep: ]: No such file or directory
grep: =: No such file or directory
grep: theprinceandthepauper: No such file or directory
homesharing.sh: line 4: syntax error near unexpected token `then'
homesharing.sh: line 4: ` then'