X7ROOT File Manager
Current Path:
/usr/local/VMOptimizationTools_2.50.0
usr
/
local
/
VMOptimizationTools_2.50.0
/
π
..
π
LinuxUpdate.XML
(645 B)
π
SangforVMSTool
(3.11 KB)
π
SangforVMSTool.service
(194 B)
π
action_common.sh
(13.34 KB)
π
busybox_cmd_ln.sh
(2.24 KB)
π
collect_test_data.sh
(1.16 KB)
π
common_config.sh
(278 B)
π
data_test_tool.sh
(12.59 KB)
π
debian_vmconfig.sh
(10.74 KB)
π
guest_system_config.sh
(1.82 KB)
π
hostname_config
(1 B)
π
log.sh
(1.36 KB)
π
mod_test.sh
(3.69 KB)
π
mod_test1.sh
(914 B)
π
net_common.sh
(915 B)
π
network_config
(1 B)
π
pwd_info_config
(1 B)
π
redhat_vmconfig.sh
(11.14 KB)
π
sangfor_guest_datareport
(21.66 KB)
π
sangfor_heartalive.sh
(2.37 KB)
π
sangfor_module_update
(28.11 KB)
π
sangfor_set_network.sh
(504 B)
π
sangfor_sfping
(3.85 KB)
π
sangfor_sshkey_gen
(1.29 KB)
π
sangfor_update_ipc_callback
(5.29 KB)
π
sangfor_vm_proxyd
(3.45 KB)
π
sangfor_vm_proxyd_r
(4.4 KB)
π
sangfor_vm_proxyd_w
(1.32 KB)
π
sangfor_vmconfig
(2.4 KB)
π
sangfor_vmconfig_common
(27.99 KB)
π
sangfor_vmconfig_ipc_callback
(4.75 KB)
π
sangfor_watchdog
(3.95 KB)
π
sfping
(13.63 KB)
π
sfping.pl
(6.15 KB)
π
startall
(1.78 KB)
π
stopall
(1.11 KB)
π
suse_vmconfig.sh
(6.19 KB)
π
tools_x64
π
tools_x86
π
uni_test.sh
(2.59 KB)
π
update_common_func
(4.35 KB)
π
update_common_header
(4.86 KB)
π
update_config
(2.89 KB)
π
update_install
(28.84 KB)
π
update_network.flag
(1 B)
π
virtio_nic_attr_set.sh
(2.42 KB)
π
virtio_nic_compat.sh.old1578331486
(5.28 KB)
π
vm_ip_recover.sh
(16.66 KB)
π
vm_ipc.sh
(9.06 KB)
π
vmconfig_common_func
(10.76 KB)
π
vmconfig_common_header
(3.37 KB)
π
vmconfig_config
(805 B)
π
vmtools-install.sh
(31.16 KB)
π
watch_test.sh
(313 B)
π
watchdog.sh
(1.39 KB)
π
x64
π
x86
Editing: sangfor_vm_proxyd_r
#! /bin/bash # vm_proxyd Read serial and distributed message logic declare g_shell_dir=`dirname "$0"` . "${g_shell_dir}/vm_ipc.sh" # The last time the wrong package information declare g_last_pkg_key="" #Read serial port data read_port() { local found_begin=0 local found_end=0 local found_length=0 local found_tunnel_hdr=0 local found_msgdata=0 local length=0 local tunnel_json="" local msgdata="" local linenum=0 while read line <&99 do linenum=$((${linenum}+1)) # The begain if [ ${found_begin} -eq 0 ]; then if [ "${line}" = "${BEGIN_TAG__}" ]; then found_begin=1 found_end=0 found_length=0 found_tunnel_hdr=0 length=0 real_len=0 tunnel_json="" msgdata="" fi elif [ "${line}" = "${END_TAG__}" ]; then found_end=1 else if [ "${line:0:${#LENGTH_TAG__}}" = "${LENGTH_TAG__}" ]; then found_length=1 length=${line#${LENGTH_TAG__}} elif [ "${line:0:${#TUNNELHDR_TAG__}}" = "${TUNNELHDR_TAG__}" ]; then found_tunnel_hdr=1 tunnel_json=${line#${TUNNELHDR_TAG__}} elif [ "${line:0:${#MSGDATA_TAG__}}" = "${MSGDATA_TAG__}" ]; then found_msgdata=1 # FIXME: There may be a problem, the maximum length of the read length may exceed the shell string. msgdata=${line#${MSGDATA_TAG__}} fi fi test $found_begin -ne 1 && continue test $found_end -ne 1 && continue test $found_length -ne 1 && continue test $found_tunnel_hdr -ne 1 && continue test $found_msgdata -ne 1 && continue # Length does not meet expectations, then re read. local real_length=$((${#tunnel_json} + ${#msgdata})) if [ ${real_length} -ne ${length} ]; then found_begin=0 continue fi # To deal with the slice local dst_modid=`vm_ipc_get_dst_modid "${tunnel_json}"` local dst_instid=`vm_ipc_get_dst_instid "${tunnel_json}"` local src_modid=`vm_ipc_get_src_modid "${tunnel_json}"` local src_instid=`vm_ipc_get_src_instid "${tunnel_json}"` local msg_type=`vm_ipc_get_msg_type "${tunnel_json}"` local pkgid=`vm_ipc_get_id "${tunnel_json}"` local frag_off=`vm_ipc_get_frag_off "${tunnel_json}"` local pkg_key=${dst_modid}_${dst_instid}_${src_modid}_${src_instid}_${msg_type}_${pkgid} local dirpath="${RECV_DIR__}/${dst_modid}/${dst_instid}" if [ ! -d "${dirpath}" ]; then mkdir -p "${dirpath}" fi local filepath="${dirpath}/mod${src_modid}_inst${src_instid}_msg${msg_type}_${pkgid}" local tmpfile="${dirpath}/.mod${src_modid}_inst${src_instid}_msg${msg_type}_${pkgid}" if [ ${frag_off} -eq 0 ]; then echo "${tunnel_json}" > "${tmpfile}.hdr" mv "${tmpfile}.hdr" "${filepath}.hdr" echo "${msgdata}" >> "${tmpfile}.msg" mv "${tmpfile}.msg" "${filepath}.msg" else local more_frag=$((${frag_off}&0x20000000)) local offset=$((${frag_off}&0x1FFFFFFF)) if [ ${offset} -eq 0 ]; then echo "${tunnel_json}" > "${tmpfile}.hdr" echo -n "${msgdata}" > "${tmpfile}.frag" # Record offset patch next echo "$((${offset}+${#msgdata}))" > "${tmpfile}.next_offset" elif [ -f "${tmpfile}.frag" -a -f "${tmpfile}.next_offset" ]; then local need_offset=`cat "${tmpfile}.next_offset"` if [ "${offset}" -ne "${need_offset}" ]; then g_last_pkg_key=${pkg_key} log "msg_type '${msg_type}': offset '${need_offset}' fragment is lost from mod '${src_modid}' inst '${src_instid}'" rm -f "${tmpfile}.hdr" rm -f "${tmpfile}.frag" rm -f "${tmpfile}.next_offset" else # To append form echo -n "${msgdata}" >> "${tmpfile}.frag" echo "$((${offset}+${#msgdata}))" > "${tmpfile}.next_offset" # The last slice if [ ${more_frag} -eq 0 ]; then mv "${tmpfile}.hdr" "${filepath}.hdr" mv "${tmpfile}.frag" "${filepath}.msg" rm -f "${tmpfile}.next_offset" fi fi else # Only one record, all the modules share a variableοΌ # Conflict records is less, not processing if [ "${pkg_key}" != "${g_last_pkg_key}" ]; then g_last_pkg_key=${pkg_key} log "msg_type '${msg_type}': first fragment is lost from mod '${src_modid}' inst '${src_instid}'" fi fi # Slice the residual cleaning implementation in vm_ipc_event_loop_once function. fi return 0 done # 255 means that the host machine is not connected test ${linenum} -eq 0 && return 255 || return 1 } main() { mkdir -p "${RECV_DIR__}" #Cyclic reading serial while true do read_port; if [ $? -eq 255 ]; then log "host is not connected" sleep 10 fi done return 0 } main exit $?
Upload File
Create Folder