-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcoreconfig-dock-remove.sh
39 lines (28 loc) · 1.06 KB
/
coreconfig-dock-remove.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
#!/bin/bash
###################################################################
#
# Script to remove applications from the dock.
# Utilises - https://github.com/kcrawford/dockutil
#
# The script removes the Remote Support and Support icons from the dock
# and sets a hidden file so that the state is retained. Script is executed
# from Self Service.
#
# Last Changed: Fri 26 Apr 2019 10:05:33 BST
# Version: 0.1.2
# Origin: https://github.com/UoE-macOS/jss.git
# Released by JSS User: dsavage
#
##################################################################
ACTIVE_USER=`ls -l /dev/console | awk '{print $3}'`
echo "Active user is $ACTIVE_USER"
DOCK_PREF="/Users/$ACTIVE_USER/Library/Preferences/com.apple.dock.plist"
echo "The Dock Pref plist is $DOCK_PREF"
# File to show opt out of dock icons.
touch /Users/$ACTIVE_USER/.NoDock
# Set the path for the dock command line tool.
DOCK_UTIL="/usr/local/bin/dockutil"
echo "The Dock Utility is at $DOCK_UTIL"
$DOCK_UTIL --remove 'RemoteSupport.url' --no-restart $DOCK_PREF
$DOCK_UTIL --remove 'Support.url' $DOCK_PREF
exit 0;