Changeset 2887 in MondoRescue for branches/2.2.9/mondo
- Timestamp:
- Oct 9, 2011, 1:03:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-files.c
r2847 r2887 1103 1103 /*@ buffers ******** */ 1104 1104 char netfs_dev[MAX_STR_LEN]; 1105 char mac_addr[MAX_STR_LEN];1106 1105 char netfs_mount[MAX_STR_LEN]; 1106 char netfs_client_hwaddr[MAX_STR_LEN]; 1107 1107 char netfs_client_ipaddr[MAX_STR_LEN]; 1108 1108 char netfs_client_netmask[MAX_STR_LEN]; … … 1131 1131 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1"); 1132 1132 strcpy(netfs_dev, call_program_and_get_last_line_of_output(command)); 1133 sprintf(command, 1134 "ifconfig %s | head -1 | awk '{print $5}'", netfs_dev); 1135 strcpy(netfs_client_hwaddr, call_program_and_get_last_line_of_output(command)); 1133 1136 sprintf(command, 1134 1137 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f7 | cut -d':' -f2"); … … 1148 1151 call_program_and_get_last_line_of_output(command)); 1149 1152 sprintf(tmp, 1150 "netfs_client_ ipaddr=%s; netfs_server_ipaddr=%s; netfs_mount=%s",1151 netfs_client_ ipaddr, netfs_server_ipaddr, netfs_mount);1153 "netfs_client_hwaddr=%s; netfs_client_ipaddr=%s; netfs_server_ipaddr=%s; netfs_mount=%s", 1154 netfs_client_hwaddr, netfs_client_ipaddr, netfs_server_ipaddr, netfs_mount); 1152 1155 if (strlen(netfs_dev) < 2) { 1153 1156 fatal_error … … 1166 1169 log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", netfs_dev); 1167 1170 sprintf(command, 1168 "ifconfig %s | awk '{print $5}' | head -n1", netfs_dev); 1169 strcpy(mac_addr, call_program_and_get_last_line_of_output(command)); 1170 sprintf(command, 1171 "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1", mac_addr,netfs_dev); 1171 "ifconfig | grep -E '%s' | grep -v '%s' | head -n1 | cut -d' ' -f1",netfs_client_hwaddr,netfs_dev); 1172 1172 strcpy(netfs_dev, call_program_and_get_last_line_of_output(command)); 1173 1173 log_to_screen("Replacing it with %s\n", netfs_dev); … … 1180 1180 write_one_liner_data_file(tmp, bkpinfo->netfs_proto); 1181 1181 1182 sprintf(tmp, "%s/NETFS-CLIENT-HWADDR", bkpinfo->tmpdir); 1183 write_one_liner_data_file(tmp, netfs_client_hwaddr); 1182 1184 sprintf(tmp, "%s/NETFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1183 1185 write_one_liner_data_file(tmp, netfs_client_ipaddr);
Note:
See TracChangeset
for help on using the changeset viewer.