Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3.6 /
site-packages /
salt /
grains /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
32
B
-rw-r--r--
2022-05-16 09:16
chronos.py
535
B
-rw-r--r--
2022-05-16 09:16
cimc.py
635
B
-rw-r--r--
2022-05-16 09:16
core.py
111.98
KB
-rw-r--r--
2022-05-16 09:16
disks.py
5.62
KB
-rw-r--r--
2022-05-16 09:16
esxi.py
2.52
KB
-rw-r--r--
2022-05-16 09:16
extra.py
2.77
KB
-rw-r--r--
2022-05-16 09:16
fibre_channel.py
1.76
KB
-rw-r--r--
2022-05-16 09:16
fx2.py
3.06
KB
-rw-r--r--
2022-05-16 09:16
iscsi.py
2.35
KB
-rw-r--r--
2022-05-16 09:16
junos.py
1.51
KB
-rw-r--r--
2022-05-16 09:16
lvm.py
1.43
KB
-rw-r--r--
2022-05-16 09:16
marathon.py
928
B
-rw-r--r--
2022-05-16 09:16
mdadm.py
800
B
-rw-r--r--
2022-05-16 09:16
mdata.py
4.09
KB
-rw-r--r--
2022-05-16 09:16
metadata.py
2.7
KB
-rw-r--r--
2022-05-16 09:16
minion_process.py
988
B
-rw-r--r--
2022-05-16 09:16
napalm.py
11.2
KB
-rw-r--r--
2022-05-16 09:16
nvme.py
1.16
KB
-rw-r--r--
2022-05-16 09:16
nxos.py
901
B
-rw-r--r--
2022-05-16 09:16
opts.py
353
B
-rw-r--r--
2022-05-16 09:16
panos.py
640
B
-rw-r--r--
2022-05-16 09:16
pending_reboot.py
650
B
-rw-r--r--
2022-05-16 09:16
philips_hue.py
1.03
KB
-rw-r--r--
2022-05-16 09:16
rest_sample.py
1.03
KB
-rw-r--r--
2022-05-16 09:16
smartos.py
6.32
KB
-rw-r--r--
2022-05-16 09:16
ssh_sample.py
927
B
-rw-r--r--
2022-05-16 09:16
zfs.py
2.13
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
import glob import logging import os import salt.utils import salt.utils.data import salt.utils.files import salt.utils.path import salt.utils.platform import salt.utils.yaml __proxyenabled__ = ["*"] log = logging.getLogger(__name__) def shell(): """ Return the default shell to use on this system """ # Provides: # shell if salt.utils.platform.is_windows(): env_var = "COMSPEC" default = r"C:\Windows\system32\cmd.exe" else: env_var = "SHELL" default = "/bin/sh" return {"shell": os.environ.get(env_var, default)} def config(): """ Return the grains set in the grains file """ if "conf_file" not in __opts__: return {} if os.path.isdir(__opts__["conf_file"]): if salt.utils.platform.is_proxy(): gfn = os.path.join( __opts__["conf_file"], "proxy.d", __opts__["id"], "grains" ) else: gfn = os.path.join(__opts__["conf_file"], "grains") else: if salt.utils.platform.is_proxy(): gfn = os.path.join( os.path.dirname(__opts__["conf_file"]), "proxy.d", __opts__["id"], "grains", ) else: gfn = os.path.join(os.path.dirname(__opts__["conf_file"]), "grains") if os.path.isfile(gfn): log.debug("Loading static grains from %s", gfn) with salt.utils.files.fopen(gfn, "rb") as fp_: try: return salt.utils.data.decode(salt.utils.yaml.safe_load(fp_)) except Exception: # pylint: disable=broad-except log.warning("Bad syntax in grains file! Skipping.") return {} return {} def __secure_boot(efivars_dir): """Detect if secure-boot is enabled.""" enabled = False sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*/data")) if len(sboot) == 1: # The minion is usually running as a privileged user, but is # not the case for the master. Seems that the master can also # pick the grains, and this file can only be readed by "root" try: with salt.utils.files.fopen(sboot[0], "rb") as fd: enabled = fd.read()[-1:] == b"\x01" except PermissionError: pass return enabled def uefi(): """Populate UEFI grains.""" efivars_dir = next( filter(os.path.exists, ["/sys/firmware/efi/efivars", "/sys/firmware/efi/vars"]), None, ) grains = { "efi": bool(efivars_dir), "efi-secure-boot": __secure_boot(efivars_dir) if efivars_dir else False, } return grains def transactional(): """Determine if the system is transactional.""" return {"transactional": bool(salt.utils.path.which("transactional-update"))}