404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.142.201.153: ~ $
3

�<�e�@sVddljZddlmZddlZddlZddlmZm	Z	ej
j�ZGdd�dej
�ZdS)�N�)�base)�Popen�PIPEcsbeZdZdZedd��Zdd�Zdd�Zdd	�Z�fd
d�Z	�fdd
�Z
ejf�fdd�	Z
�ZS)�ScriptPluginac
	`script`::
	
	Executes an external script or binary when the profile is loaded or
	unloaded. You can choose an arbitrary executable.
	+
	IMPORTANT: The `script` plug-in is provided mainly for compatibility
	with earlier releases. Prefer other *TuneD* plug-ins if they cover
	the required functionality.
	+
	*TuneD* calls the executable with one of the following arguments:
	+
	--
	** `start` when loading the profile
	** `stop` when unloading the profile
	--
	+
	You need to correctly implement the `stop` action in your executable
	and revert all settings that you changed during the `start`
	action. Otherwise, the roll-back step after changing your *TuneD*
	profile will not work.
	+
	Bash scripts can import the [filename]`/usr/lib/tuned/functions`
	Bash library and use the functions defined there. Use these
	functions only for functionality that is not natively provided
	by *TuneD*. If a function name starts with an underscore, such as
	`_wifi_set_power_level`, consider the function private and do not
	use it in your scripts, because it might change in the future.
	+
	Specify the path to the executable using the `script` parameter in
	the plug-in configuration.
	+
	.Running a Bash script from a profile
	====
	To run a Bash script named `script.sh` that is located in the profile
	directory, use:
	
	----
	[script]
	script=${i:PROFILE_DIR}/script.sh
	----
	====
	cCsddiS)N�script�)�selfrr�#/usr/lib/python3.6/plugin_script.py�_get_config_options6sz ScriptPlugin._get_config_optionscCs2d|_d|_|jddk	r(|jd|_ng|_dS)NTFr)Z_has_static_tuningZ_has_dynamic_tuningZoptions�_scripts)r	�instancerrr
�_instance_init<s
zScriptPlugin._instance_initcCsdS)Nr)r	r
rrr
�_instance_cleanupFszScriptPlugin._instance_cleanupc
Csd}�x|D�]�}tj}|j|jj��tjd|t|�f�tjdtt	|j
����ytt|g|ttd|dtj
j|�d�}|j�\}}t|�r�tjd||dd
�f�|jr�tjd||jf�d}Wqttfk
�r
}	ztjd	||	f�d}WYdd}	~	XqXqW|S)NTz'calling script '%s' with arguments '%s'zusing environment '%s')�stdout�stderrZ	close_fds�envZuniversal_newlines�cwdzscript '%s' error output: '%s'rz#script '%s' returned error code: %dFzscript '%s' error: %s���)�os�environ�updateZ
_variablesZget_env�log�info�str�debug�list�itemsrr�path�dirnameZcommunicate�len�error�
returncode�OSError�IOError)
r	�scriptsZ	arguments�retrr�proc�out�err�errr
�
_call_scriptsIs,
zScriptPlugin._call_scriptscs$tt|�j|�|j|jdg�dS)N�start)�superr�_instance_apply_staticr+r)r	r
)�	__class__rr
r.asz#ScriptPlugin._instance_apply_staticcstd}tt|�j|||�dkr d}dg}|r4|dg7}|j|j|�dkrZtjtj|j�ntj	tj
|j�d}|S)NTFZverify�ignore_missing)r-r�_instance_verify_staticr+rrr�constsZSTR_VERIFY_PROFILE_OKr!ZSTR_VERIFY_PROFILE_FAIL)r	r
r0Zdevicesr&�args)r/rr
r1es
z$ScriptPlugin._instance_verify_staticcsBdg}|tjkr|dg}|jt|j�|�tt|�j||�dS)N�stopZ
full_rollback)r2Z
ROLLBACK_FULLr+�reversedrr-r�_instance_unapply_static)r	r
Zrollbackr3)r/rr
r6ts


z%ScriptPlugin._instance_unapply_static)�__name__�
__module__�__qualname__�__doc__�classmethodrrrr+r.r1r2Z
ROLLBACK_SOFTr6�
__classcell__rr)r/r
r	s+
r)Ztuned.constsr2�rZ
tuned.logsZtunedr�
subprocessrrZlogs�getrZPluginrrrrr
�<module>s



Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 173 B 0644
__init__.cpython-36.pyc File 173 B 0644
base.cpython-36.opt-1.pyc File 21.13 KB 0644
base.cpython-36.pyc File 21.13 KB 0644
decorators.cpython-36.opt-1.pyc File 1.06 KB 0644
decorators.cpython-36.pyc File 1.06 KB 0644
exceptions.cpython-36.opt-1.pyc File 354 B 0644
exceptions.cpython-36.pyc File 354 B 0644
hotplug.cpython-36.opt-1.pyc File 4.23 KB 0644
hotplug.cpython-36.pyc File 4.23 KB 0644
plugin_acpi.cpython-36.opt-1.pyc File 3.35 KB 0644
plugin_acpi.cpython-36.pyc File 3.35 KB 0644
plugin_audio.cpython-36.opt-1.pyc File 4.03 KB 0644
plugin_audio.cpython-36.pyc File 4.03 KB 0644
plugin_bootloader.cpython-36.opt-1.pyc File 24.45 KB 0644
plugin_bootloader.cpython-36.pyc File 24.45 KB 0644
plugin_cpu.cpython-36.opt-1.pyc File 26.03 KB 0644
plugin_cpu.cpython-36.pyc File 26.06 KB 0644
plugin_disk.cpython-36.opt-1.pyc File 16.35 KB 0644
plugin_disk.cpython-36.pyc File 16.35 KB 0644
plugin_eeepc_she.cpython-36.opt-1.pyc File 3.43 KB 0644
plugin_eeepc_she.cpython-36.pyc File 3.43 KB 0644
plugin_irqbalance.cpython-36.opt-1.pyc File 4.51 KB 0644
plugin_irqbalance.cpython-36.pyc File 4.51 KB 0644
plugin_modules.cpython-36.opt-1.pyc File 5.45 KB 0644
plugin_modules.cpython-36.pyc File 5.45 KB 0644
plugin_mounts.cpython-36.opt-1.pyc File 5.5 KB 0644
plugin_mounts.cpython-36.pyc File 5.5 KB 0644
plugin_net.cpython-36.opt-1.pyc File 23.21 KB 0644
plugin_net.cpython-36.pyc File 23.21 KB 0644
plugin_rtentsk.cpython-36.opt-1.pyc File 1.34 KB 0644
plugin_rtentsk.cpython-36.pyc File 1.34 KB 0644
plugin_scheduler.cpython-36.opt-1.pyc File 53.44 KB 0644
plugin_scheduler.cpython-36.pyc File 53.44 KB 0644
plugin_script.cpython-36.opt-1.pyc File 4.26 KB 0644
plugin_script.cpython-36.pyc File 4.31 KB 0644
plugin_scsi_host.cpython-36.opt-1.pyc File 4.56 KB 0644
plugin_scsi_host.cpython-36.pyc File 4.56 KB 0644
plugin_selinux.cpython-36.opt-1.pyc File 3 KB 0644
plugin_selinux.cpython-36.pyc File 3 KB 0644
plugin_service.cpython-36.opt-1.pyc File 13.84 KB 0644
plugin_service.cpython-36.pyc File 13.84 KB 0644
plugin_sysctl.cpython-36.opt-1.pyc File 6.7 KB 0644
plugin_sysctl.cpython-36.pyc File 6.7 KB 0644
plugin_sysfs.cpython-36.opt-1.pyc File 3.64 KB 0644
plugin_sysfs.cpython-36.pyc File 3.64 KB 0644
plugin_systemd.cpython-36.opt-1.pyc File 5.92 KB 0644
plugin_systemd.cpython-36.pyc File 5.92 KB 0644
plugin_uncore.cpython-36.opt-1.pyc File 4.75 KB 0644
plugin_uncore.cpython-36.pyc File 4.75 KB 0644
plugin_usb.cpython-36.opt-1.pyc File 2.95 KB 0644
plugin_usb.cpython-36.pyc File 2.95 KB 0644
plugin_video.cpython-36.opt-1.pyc File 4.13 KB 0644
plugin_video.cpython-36.pyc File 4.13 KB 0644
plugin_vm.cpython-36.opt-1.pyc File 4.11 KB 0644
plugin_vm.cpython-36.pyc File 4.11 KB 0644
repository.cpython-36.opt-1.pyc File 1.87 KB 0644
repository.cpython-36.pyc File 1.92 KB 0644