403Webshell
Server IP : 103.119.228.120  /  Your IP : 18.218.95.236
Web Server : Apache
System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : nobody ( 99)
PHP Version : 5.6.40
Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime
MySQL : ON |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /usr/share/zsh/5.0.2/functions/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/share/zsh/5.0.2/functions/_modutils
#compdef lsmod modinfo modprobe rmmod insmod

_modules_caching_policy()
{
    # Rebuild if $modules_dir is newer than the cache, or every week.
    local -a oldp

    oldp=( "$1"(Nmw+0) )
    (( $#oldp )) || [[ $modules_dir -nt $1 ]]
}

_modutils() {
    local curcontext="$curcontext" expl state line modules ign args ret=1
    local -r modules_dir=/lib/modules

    local update_policy
    zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
    if [[ -z "$update_policy" ]]; then
	zstyle ":completion:*:*:$service:*" cache-policy _modules_caching_policy
    fi

    args=(
	'(-)'{-V,--version}'[print version]'
	'(-)'{-h,--help}'[print help text]'
    )

    case "$service" in
	lsmod) _arguments -s "$args[@]" && return ;;

	modinfo)
	    _arguments -s -C "$args[@]" \
		'(-)'{-a,--author}"[display the module's author]" \
		'(-)'{-d,--description}"[display the module's description]" \
		'(-)'{-l,--license}"[display the module's license]" \
		'(-)'{-n,--filename}"[display the module's filename]" \
		'(-)'{-p,--parameters}'[display the typed parameters that a module may support]' \
		'(-)'{-F,--field}"[display only selected module's information]:module_field:(alias author depends description filename license parm)" \
		'(-)-k[use modules from a different kernel version]:kernel_version:($(echo $modules_dir/*(/\:t)))' \
		'1:module file:->all_modules' && ret=0
	    ;;

	modprobe)
	    ign='-h --help -V --version -c --showconfig'
	    _arguments -s -C "$args[@]" \
		"(-a --all $ign)"{-a,--all}'[load all matching modules]' \
		'(-)'{-c,--showconfig}'[show current configuration]' \
		"(-d --debug $ign)"{-d,--debug}'[print debug info]' \
		"(-k --autoclean $ign)"{-k,--autoclean}'[set autoclean]' \
		"(-n --show $ign)"{-n,--show}"[don't actually perform action]" \
		"(-q --quiet $ign)"{-q,--quiet}"[don't complain about insmod failures]" \
		"(-s --syslog $ign)"{-s,--syslog}'[report via syslog instead of stderr]' \
		"(* -t --type $ign)"{-t,--type}'[module type]:module type' \
		"(-v --verbose $ign)"{-v,--verbose}'[print all commands as executed]' \
		'(-C --config)'{-C,--config}'[specify config file]:config file:_files' \
		"(-r --remove -l --list -t --type -a --all $ign)"{-r,--remove}'[remove module (stacks)]' \
		"(-l --list -t --type -a --all $ign)"{'-i[ignore install/remove commands in config file]','--ignore-install[ignore install commands in config file]','--ignore-remove[ignore remove commands in config file]'} \
		"(* -l --list -r --remove $ign)"{-l,--list}'[list matching modules]' \
		"(-c $ign)1:modules:->loadable_modules" \
		"(-c -l --list -t --type $ign)*:params:->params" && ret=0

	    [[ -n $state ]] && (( $+opt_args[-r] )) && state=loaded_modules
	    ;;

	rmmod)
	    _arguments -s -C "$args[@]" \
		'(-a --all)'{-a,--all}'[remove all unused autocleanable modules]' \
		'(-e --persist)'{-e,--persist}'[save persistent data]' \
		'(-r --stacks)'{-r,--stacks}'[remove a module stack]' \
		'(-s --syslog)'{-s,--syslog}'[output to syslog]' \
		'(-v --verbose)'{-v,--verbose}'[be verbose]' \
		'*:loaded module:->loaded_modules' && ret=0
	    ;;

	insmod)
	    _arguments \
		'1:module file:_files' \
		'*:module parameters:' && ret=0
	    ;;
    esac 

    case "$state" in
	loaded_modules|loadable_modules)
	    if [[ -r /proc/modules ]]; then
		loaded_modules=(${${(f)"$(</proc/modules)"}%% *})
	    elif [[ -x /sbin/lsmod ]]; then
		loaded_modules=(${${(f)"$(/sbin/lsmod)"}[2,-1]%% *})
	    else
		return 1
	    fi

	    if [[ $state = loaded_modules ]]; then
		_wanted modules expl 'loaded module' compadd -a loaded_modules \
		    && return
		return ret
	    fi
	    ;&

	all_modules)
	    local kver
	    integer kver_idx
	    if (( kver_idx=${words[(I)-k]} )); then
		kver=${words[kver_idx+1]}
	    else
		kver=$(uname -r)
	    fi

	    if _cache_invalid modules-$kver || ! _retrieve_cache modules-$kver;
	    then 
		# 2011-01-02 gi1242: Do we need .o files? Or is .ko enough?
		modules=( $modules_dir/$kver/(*~(source|build))/**/*.(o|ko|ko.gz)(.:t:r:r) )
		_store_cache modules-$kver modules
	    fi

	    if [[ $state = loadable_modules ]]; then
		modules=( ${modules:#(${(j:|:)~${=loaded_modules//_/-}})} )
	    fi

	    _tags files modules
	    while _tags; do
		_requested files expl "module file"  _files -g '*.ko(-.)' && ret=0
		_requested modules expl module compadd -a modules && ret=0
	    done
	    ;;

	params)
	    if compset -P '*='; then
		_message -e value 'parameter value'
	    else
		local params
		params=( ${${(M)${(f)"$(_call_program module_parameter modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} )
		if [[ $#params -eq 0 ]]; then
		    _message -e parameter "This modules doesn't have parameters"
		else
		    typeset -A val_args

		    _values -S = -C -w 'module parameter' \
			${${${(M)params:#*(:bool|\(bool\))}/:/[}/(bool| \(bool\))/]} ${^${params:#*(:bool|\(bool\))}/:/[}"]:auto added argument: " && ret=0
		fi
	    fi
	    ;;
    esac

    return ret
}

_modutils "$@"

Youez - 2016 - github.com/yon3zu
LinuXploit