Skip to content

Commit

Permalink
Add MachServices, WatchPaths + permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod authored Jul 9, 2018
1 parent 3aeb87e commit 9c3010c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion maclaunch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ function listItems {

while IFS= read -r -d '' f; do

# check if file is readable
if ! [ -r "$f" ]; then
echo -e "\nSkipping unreadable file: $f\n"
continue
fi

# convert plist to XML if it is binary
if ! content=$(plutil -convert xml1 "${f}" -o -); then
echo "\nSkipping unreadable file: $f\n"
error "Unparseable file: $f"
fi

type="system" ; [[ "$f" =~ .*LaunchAgents.* ]] && type="user"
Expand Down Expand Up @@ -104,6 +110,12 @@ function listItems {
if echo "$content" | grep -q 'StartInterval'; then
load_items+=("${RED}Periodically")
fi
if echo "$content" | grep -q "MachServices"; then
load_items+=("${RED}MachService")
fi
if echo "$content" | grep -q "WatchPaths"; then
load_items+=("${YELLOW}WatchPaths")
fi
fi
fi

Expand Down

0 comments on commit 9c3010c

Please sign in to comment.