403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/mac_assistive.py
"""
Allows you to manage assistive access on macOS minions with 10.9+
=================================================================

Install, enable and disable assistive access on macOS minions

.. code-block:: yaml

    /usr/bin/osacript:
      assistive.installed:
        - enabled: True
"""

import logging

import salt.utils.platform
from salt.utils.versions import Version

log = logging.getLogger(__name__)

__virtualname__ = "assistive"


def __virtual__():
    """
    Only work on Mac OS
    """
    if salt.utils.platform.is_darwin() and Version(__grains__["osrelease"]) >= Version(
        "10.9"
    ):
        return True
    return (False, "Only supported on Mac OS 10.9+")


def installed(name, enabled=True):
    """
    Make sure that we have the given bundle ID or path to command
    installed in the assistive access panel.

    name
        The bundle ID or path to command

    enable
        Should assistive access be enabled on this application?

    """
    ret = {"name": name, "result": True, "comment": "", "changes": {}}

    is_installed = __salt__["assistive.installed"](name)

    if is_installed:
        is_enabled = __salt__["assistive.enabled"](name)

        if enabled != is_enabled:
            __salt__["assistive.enable"](name, enabled)
            ret["comment"] = f"Updated enable to {enabled}"
        else:
            ret["comment"] = "Already in the correct state"

    else:
        __salt__["assistive.install"](name, enabled)
        ret["comment"] = f"Installed {name} into the assistive access panel"

    return ret

Youez - 2016 - github.com/yon3zu
LinuXploit