#!/bin/bash

# Define the destination path for Firefox policies
destination="/Applications/Firefox.app/Contents/Resources/distribution"

# Check if the directory exists; if not, create it
if [ ! -d "$destination" ]; then
    sudo mkdir -p "$destination"
fi

# Define the URL to the policies.json file
url="https://spin.ai/wp-content/uploads/kb/google-workspace/policies.json"

# Define the output path for the policies.json file
outputPath="$destination/policies.json"

# Download the policies.json file
curl -o "$outputPath" "$url"

# Set correct ownership for the policies.json file (root:admin)
sudo chown root:admin "$outputPath"
