mirror of
https://github.com/PurpleComputing/helpful-scripts.git
synced 2026-02-03 05:43:24 +00:00
Update speedtest.sh
This commit is contained in:
14
speedtest.sh
14
speedtest.sh
@@ -1,8 +1,18 @@
|
||||
runAsUser() {
|
||||
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
|
||||
currentUserID=$(id -u "$currentUser")
|
||||
|
||||
if [ "$currentUser" != "loginwindow" ]; then
|
||||
/bin/launchctl asuser "$currentUserID" sudo -u "$currentUser" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
cd /Library/Application\ Support/Purple
|
||||
rm -rf speedtest-cli
|
||||
curl -s -Lo speedtest-cli https://github.com/PurpleComputing/mdmscripts/raw/main/Helpers/speedtest
|
||||
xattr -r -d com.apple.quarantine speedtest-cli
|
||||
chmod +x speedtest-cli
|
||||
chmod 777 speedtest-cli
|
||||
echo Running Speed Test
|
||||
sleep 10
|
||||
./speedtest-cli --accept-license --accept-gdpr >> /tmp/speedtest.log
|
||||
|
||||
runAsUser /Library/Application\ Support/Purple/speedtest-cli --accept-license --accept-gdpr >> /tmp/speedtest.log
|
||||
|
||||
Reference in New Issue
Block a user