X7ROOT File Manager
Current Path:
/var/VMOptimizationToolsLinux
var
/
VMOptimizationToolsLinux
/
π
..
π
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)
π
log.sh
(1.36 KB)
π
mod_test.sh
(3.69 KB)
π
mod_test1.sh
(914 B)
π
net_common.sh
(915 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.c
(15.68 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)
π
virtio_nic_attr_set.sh
(2.42 KB)
π
virtio_nic_compat.sh
(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: mod_test.sh
#!/bin/bash # Test codeοΌUsed for testing the transmission module shell_dir=`dirname "$0"` . "${shell_dir}/vm_ipc.sh" proc_msg_10001() { local peer_modid=${1} local peer_instid=${2} local datafile=${3} local data=`cat "${datafile}"` echo "recv data from mod ${peer_modid} inst ${peer_instid}: ${data}" # Back to the pack for test local answer='{"people":[{"name":"hellworld[0]","age":0,"note":"nice to meet you!!!!"},{"name":"hellworld[1]","age":1,"note":"nice to meet you!!!!"},{"name":"hellworld[2]","age":2,"note":"nice to meet you!!!!"},{"name":"hellworld[3]","age":3,"note":"nice to meet you!!!!"},{"name":"hellworld[4]","age":4,"note":"nice to meet you!!!!"},{"name":"hellworld[5]","age":5,"note":"nice to meet you!!!!"},{"name":"hellworld[6]","age":6,"note":"nice to meet you!!!!"},{"name":"hellworld[7]","age":7,"note":"nice to meet you!!!!"},{"name":"hellworld[8]","age":8,"note":"nice to meet you!!!!"},{"name":"hellworld[9]","age":9,"note":"nice to meet you!!!!"}]}' vm_ipc_to_local_host ${peer_modid} ${peer_instid} 10002 "${answer}" || return 1 echo "answer: ${answer}" return 0 } proc_msg_10003() { local peer_modid=${1} local peer_instid=${2} local datafile=${3} echo "recv file from mod ${peer_modid} inst ${peer_instid}: ${data}" # If you use echo analysis may be truncated because here is to transfer files. local filename=`get_value_from_json_file "${datafile}" filename` local filesize=`get_value_from_json_file "${datafile}" filesize` # The binary data using the base64 transcoding. # Note here that regular requirements of data field is not the last field. sed 's/.*"data":"\(.*\)",.*/\1/g' "${datafile}" | base64 -d > /var/recv return 0 } proc_msg_10004() { local peer_modid=${1} local peer_instid=${2} local datafile=${3} echo "send file to host mod ${peer_modid} inst ${peer_instid}: ${data}" local filename=`get_value_from_json_file "${datafile}" note` base64 "${filename}" > /var/send.tmp local filesize=`stat -c %s "${filename}"` local basefilename=`basename "${filename}"` echo -n "{\"filename\":\"${basefilename}\",\"filesize\":\"${filesize}\",\"data\":\"" > /var/send.tmp # base64 add --wrap to avoid wrap base64 --wrap=0 "${filename}" >> /var/send.tmp echo "\",\"offset\":\"0\"}" >> /var/send.tmp vm_ipc_to_local_host ${peer_modid} ${peer_instid} 10003 "/var/send.tmp" || return 1 } proc_msg_10005() { local peer_modid=${1} local peer_instid=${2} local datafile=${3} local data=`cat "${datafile}"` echo "recv data from mod ${peer_modid} inst ${peer_instid}: ${data}" # Back to the pack for test local answer='{"people":[{"name":"hellworld[0]","age":0,"note":"nice to meet you!!!!"},{"name":"hellworld[1]","age":1,"note":"nice to meet you!!!!"},{"name":"hellworld[2]","age":2,"note":"nice to meet you!!!!"},{"name":"hellworld[3]","age":3,"note":"nice to meet you!!!!"},{"name":"hellworld[4]","age":4,"note":"nice to meet you!!!!"},{"name":"hellworld[5]","age":5,"note":"nice to meet you!!!!"},{"name":"hellworld[6]","age":6,"note":"nice to meet you!!!!"},{"name":"hellworld[7]","age":7,"note":"nice to meet you!!!!"},{"name":"hellworld[8]","age":8,"note":"nice to meet you!!!!"},{"name":"hellworld[9]","age":9,"note":"nice to meet you!!!!"}]}' vm_ipc_to_self ${peer_modid} ${peer_instid} 10006 "${answer}" || return 1 echo "answer: ${answer}" return 0 } main() { local modid=123 local instid=234 vm_ipc_init ${modid} ${instid} if [ $? -ne 0 ]; then log "vm_ipc_init() failed! modid='${modid}' instid='${instid}'" return 1 fi vm_ipc_reg_callback 10001 proc_msg_10001 vm_ipc_reg_callback 10003 proc_msg_10003 vm_ipc_reg_callback 10004 proc_msg_10004 vm_ipc_reg_callback 10005 proc_msg_10005 while true do vm_ipc_event_loop_once sleep 1 done } main
Upload File
Create Folder