-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteamviewer-host-install-auth.sh
41 lines (33 loc) · 1.63 KB
/
teamviewer-host-install-auth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## PURPLE CUSTOMCOMMAND TEMPLATE ##
##-------------------------------##
##-------------------------------##
## SET VARIABLES ##
APPNAME='TeamViewer'
TVCOMPUTERGROUP="Group Name from TeamViewer Computers & Contacts"
TVAPITOPKEN="00000000-aaabbbcccdddeeefff"
TVPKGCODE="" # CODE FROM THE URL AS PER HERE https://dl.tvcdn.de/download/version_15x/CustomDesign/Install%20TeamViewerHost-[[TVPKGCODE]].pkg
TVCOMPUTERNAME="%LastConsoleUser%-%ProductName%"
##-------------------------------##
## RUN SCRIPT ##
##-------------------------------##
cd /tmp
cat << EOF > choices.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array> <dict> <key>attributeSetting</key> <integer>1</integer> <key>choiceAttribute</key> <string>selected</string> <key>choiceIdentifier</key> <string>com.teamviewer.teamviewerhostSilentInstaller</string> </dict>
</array>
</plist>
EOF
killall TeamViewer
rm -rf /Applications/TeamViewer*
curl -L https://dl.tvcdn.de/download/version_15x/CustomDesign/Install%20TeamViewerHost-$TVPKGCODE.pkg -o Install%20TeamViewerHost-$TVPKGCODE.pkg
installer -applyChoiceChangesXML choices.xml -pkg Install%20TeamViewerHost-$TVPKGCODE.pkg -target /
echo "10 seconds wait"
sleep 10
echo "Assigning TeamViewer Device to our Account..." # >> /var/tmp/depnotify.log
echo "Running the account assignment"
sudo /Applications/TeamViewerHost.app/Contents/Helpers/TeamViewer_Assignment -api-token $TVAPITOKEN -alias $TVCOMPUTERNAME -group $TVCOMPUTERGROUP -grant-easy-access
sleep 5
# END SCRIPT WITH SUCCESS
exit 0