Server IP : 103.119.228.120 / Your IP : 18.117.158.124 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/local/ssl/local/ssl/share/zsh/5.0.2/functions/ |
Upload File : |
# Expect one of a series of regular expressions from $TCP_SESS. # Can make backreferences to be handled by $match. Returns 0 for # successful match, 1 for error, 2 for timeout. # # This function has no facility for conditionally calling code based # the regular expression found. This should be done in the calling code # by testing $TCP_LINE, which contains the line which matched the # regular expression. The complete set of lines read while waiting for # this line is available in the array $tcp_expect_lines (including $TCP_LINE # itself which will be the final element). Alternatively, use -p pind # which sets $pind to the index of the pattern which matched. It # will be set to 0 otherwise. # # Many of the options are passed straight down to tcp_read. # # Options: # -a Run tcp_expect across all sessions; the first pattern matched # from any session is used. The TCP output prompt can be # used to decide which session matched. # -l list # Comma-separated list of sessions as for tcp_read. # -p pv If the Nth of a series of patterns matches, set the parameter # whose name is given by $pv to N; in the case of a timeout, # set it to -1; otherwise (unless the function exited prematurely), # set it to 0. # To avoid namespace clashes, the parameter's name must # not begin with `_expect'. # -q Quiet, passed down to tcp_read. Bad option and argument # usage is always reported. # -s sess # Expect from session sess. May be repeated for multiple sessions. # -t to Timeout in seconds (may be floating point) per read operation. # tcp_expect will only time out if every read operation takes longer # than to # -T TO Overall timeout; tcp_expect will time out if the overall operation # takes longer than this many seconds. emulate -L zsh setopt extendedglob if [[ ${(t)SECONDS} != float* ]]; then # If called from another function, use that typeset -F TCP_SECONDS_START=$SECONDS # Get extra accuracy by making SECONDS floating point locally typeset -F SECONDS fi # Variables are all named _expect_* to avoid problems with the -p param. local _expect_opt _expect_pvar local -a _expect_read_args float _expect_to1 _expect_to_all _expect_to _expect_new_to integer _expect_i _expect_stat while getopts "al:p:qs:t:T:" _expect_opt; do case $_expect_opt in (a) _expect_read_args+=(-a) ;; (l) _expect_read_args+=(-l $OPTARG) ;; (p) _expect_pvar=$OPTARG if [[ $_expect_pvar != [a-zA-Z_][a-zA-Z_0-9]# ]]; then print "invalid parameter name: $_expect_pvar" >&2 return 1 fi if [[ $_expect_pvar = _expect* ]]; then print "$0: parameter names staring \`_expect' are reserved." return 1 fi eval "$_expect_pvar=0" ;; (q) _expect_read_args+=(-q) ;; (s) _expect_read_args+=(-s $OPTARG) ;; (t) _expect_to1=$OPTARG ;; (T) _expect_to_all=$(( SECONDS + $OPTARG )) ;; (\?) return 1 ;; (*) print Unhandled option $_expect_opt, complain >&2 return 1 ;; esac done (( OPTIND > 1 )) && shift $(( OPTIND - 1 )) typeset -ga tcp_expect_lines tcp_expect_lines=() while true; do if (( _expect_to_all || _expect_to1 )); then _expect_to=0 (( _expect_to1 )) && (( _expect_to = _expect_to1 )) if (( _expect_to_all )); then # overall timeout, see if it has already triggered if (( (_expect_new_to = (_expect_to_all - SECONDS)) <= 0 )); then [[ -n $_expect_pvar ]] && eval "$_expect_pvar=-1" return 2 fi if (( _expect_to <= 0 || _expect_new_to < _expect_to )); then _expect_to=$_expect_new_to fi fi tcp_read $_expect_read_args -t $_expect_to _expect_stat=$? else tcp_read $_expect_read_args -b _expect_stat=$? fi if (( _expect_stat )); then [[ -n $_expect_pvar ]] && eval "$_expect_pvar=-1" return $_expect_stat fi tcp_expect_lines+=($TCP_LINE) for (( _expect_i = 1; _expect_i <= $#; _expect_i++ )); do if [[ "$TCP_LINE" = ${~argv[_expect_i]} ]]; then [[ -n $_expect_pvar ]] && eval "$_expect_pvar=\$_expect_i" return 0 fi done done