0 aˆÍÖ ƒd‹Õ¾Ó aa Á]›iáã@sXddlmZddlTddlZddlmZddlZddlZej   ¡Z Gdd„dej ƒZ dS)é)Úbase)Ú*éN)Úcommandsc@sjeZdZdZdd„Zdd„Zedd„ƒZdd „Zd d „Z d d „Z e ddd�dd„ƒZ e dƒddd„ƒZdS)Ú USBPluginaÇ Sets autosuspend timeout of USB devices to the value specified by the [option]`autosuspend` option in seconds. If the [option]`devices` option is specified, the [option]`autosuspend` option applies to only the USB devices specified, otherwise it applies to all USB devices. The value `0` means that autosuspend is disabled. .Turn off USB autosuspend for USB devices `1-1` and `1-2` ==== ---- [usb] devices=1-1,1-2 autosuspend=0 ---- ==== cCsJd|_tƒ|_tƒ|_|j d¡ dd¡D]}|j |j¡q*t ƒ|_ dS)NTÚusbZDEVTYPEZ usb_device) Z_devices_supportedÚsetZ _free_devicesZ_assigned_devicesÚ_hardware_inventoryZ get_devicesZmatch_propertyÚaddZsys_namerÚ_cmd©ÚselfÚdevice©rú(óz1USBPlugin._get_device_objects..r)r ZdevicesrrrÚ_get_device_objects'szUSBPlugin._get_device_objectscCsddiS)NÚ autosuspendrrrrrÚ_get_config_options*sÿzUSBPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning©r ÚinstancerrrÚ_instance_init0szUSBPlugin._instance_initcCsdS)NrrrrrÚ_instance_cleanup4szUSBPlugin._instance_cleanupcCsd|S)Nz)/sys/bus/usb/devices/%s/power/autosuspendrr rrrÚ_autosuspend_sysfile7szUSBPlugin._autosuspend_sysfilerT)Z per_devicec CsR| |¡}|durdS|rdnd}|sN| |¡}|jj|||rFtjgndd�|S)NÚ1Ú0F©Zno_error)Z _option_boolrr Z write_to_fileÚerrnoÚENOENT) r ÚvaluerrZsimÚremoveÚenableÚvalÚsys_filerrrÚ_set_autosuspend:s    ÿzUSBPlugin._set_autosuspendFcCs| |¡}|jj||d� ¡S)Nr!)rr Z read_fileÚstrip)r rrZignore_missingr(rrrÚ_get_autosuspendGs zUSBPlugin._get_autosuspendN)F)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrÚ classmethodrrrrZ command_setr)Z command_getr+rrrrr s    r)ÚrZ decoratorsZ tuned.logsZtunedZtuned.utils.commandsrÚglobr"ZlogsÚgetÚlogZPluginrrrrrÚs    cˆÒÖ ƒAsÕ¾Ó pc#!/usr/local/cpanel/3rdparty/bin/perl my $hasnetsslftp; eval { require Net::FTPSSL; $hasnetsslftp = 1; }; die if ( !$hasnetsslftp ); my (%ARGS) = parseargv(); if ( $ARGS{user} eq "" ) { die "Sorry, you must specify a user to login to the remote server as."; } if ( $ARGS{host} eq "" ) { die "Sorry, you must specify a remote server."; } if ( $ARGS{srcfile} eq "" ) { die "Sorry you must specify a source file.\n"; } if ( $ARGS{destfile} eq "" ) { die "Sorry you must specify a destfile file.\n"; } if ( $ARGS{port} eq "22" ) { print "Assuming port 21 since 22 was specified!\n"; $ARGS{port} = 21; } my $pass = ; chomp($pass); if ( my $pid = fork() ) { while ( waitpid( $pid, 1 ) != -1 ) { print ".\n"; sleep(1); } } else { my $ftp; if ( $ARGS{'port'} ne "" ) { $ftp = Net::FTPSSL->new( $ARGS{host}, Debug => 1, Passive => 1, Port => $ARGS{'port'}, encryption => 'E' )