Server IP : 103.119.228.120 / Your IP : 18.224.56.127 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 : |
#autoload _svcs_fmri() { local type="$argv[$#]" local fmri_abbrevs m i typeset -a -g _smf_fmris local update_policy zstyle -s ":completion:${curcontext}:" cache-policy update_policy if [[ -z "$update_policy" ]]; then zstyle ":completion:${curcontext}:" cache-policy _smf_caching_policy fi # The cache really must be per-host local cache_id=smf_fmri:$HOST # TODO: Do something useful with the expand and/or ambiguous styles. case $type in (-i|-c) # We probably also need an option to eliminate ambiguous # results for use in places where that's not allowed. # Grab all FMRIs that have a word beginning with $PREFIX, # making sure not to return the portion of the FMRI before # $PREFIX. Use the cache if it exists and the user wants to. if ( [[ $#_smf_fmris -eq 0 ]] || _cache_invalid $cache_id ) \ && ! _retrieve_cache $cache_id; then _smf_fmris=( ${(f)"$(svcs -a -H -o fmri)"} ) _store_cache $cache_id _smf_fmris fi # Each element of the array is removed which doesn't match # (^|.*/)$PREFIX.* fmri_abbrevs=( ${(M)_smf_fmris:#((#s)|*[/:])$PREFIX*} ) # Go through the remaining elements and remove the characters # in front of $PREFIX. for ((i = 1; i <= $#fmri_abbrevs; i++ )); do # Either one of these will work, but they're too # greedy, preventing multiple matches below. fmri_abbrevs[i]=${${fmri_abbrevs[i]}/((#s)|*[\/:])(#b)($PREFIX*)/$match[1]} #fmri_abbrevs[i]=${${(M)${fmri_abbrevs[i]}:#(#b)((#s)|*/)$PREFIX*}#$match[1]} done # Remove the "default" instance identifier if it's the only # instance for a given service (not for svccfg). if [[ $type == "-i" ]]; then local -a svcs insts nabbrevs local s svcs=( ${(u)fmri_abbrevs%:*} ) for s in $svcs; do insts=( ${(@M)fmri_abbrevs:#$s:*} ) if [[ $#insts -eq 1 && $insts[1] == *":default" ]]; then nabbrevs=($nabbrevs ${insts//:default}) elif [[ $#insts -eq 0 ]]; then # Turns out we're completing the # instance name. nabbrevs=($nabbrevs $s) else nabbrevs=($nabbrevs $insts) fi done fmri_abbrevs=( $nabbrevs ) fi # After playing with _multi_parts, I'm not sure it's actually # that useful. # _wanted fmri expl "full or unambiguously abbreviated FMRIs" \ # _multi_parts -i / fmri_abbrevs _wanted fmri expl "full or unambiguously abbreviated FMRIs" \ compadd $fmri_abbrevs ;; (-m) _wanted fmri expl "milestone FMRIs" \ compadd $(svcs -H -o fmri svc:/milestone/\*) all ;; (-r) # TODO: need some way to pick out only restarters _wanted fmri expl "restarter FMRIs" \ compadd master reset svc:/network/inetd:default ;; (*) _message "unknown argument to _svcs_fmri: $type" ;; esac } _smf_caching_policy() { # /etc/svc/repository.db is not a public interface, so this is kinda # grody. [[ ! -f "$1" || /etc/svc/repository.db -nt "$1" ]] } _svcs_fmri "$@"