Changeset 2296 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-tools.c
- Timestamp:
- Jul 23, 2009, 2:53:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2291 r2296 610 610 611 611 log_it("isodir = %s", bkpinfo->isodir); 612 mr_asprintf(&command, "df -P %s | tail -n1 | cut -d' ' -f1", 613 bkpinfo->isodir); 612 mr_asprintf(&command, "df -P %s | tail -n1 | cut -d' ' -f1", bkpinfo->isodir); 614 613 log_it("command = %s", command); 615 614 log_it("res of it = %s", call_program_and_get_last_line_of_output(command)); … … 911 910 ("ln -sf `which mkfs.msdos` /sbin/mkfs.vfat", FALSE); 912 911 } 913 mr_asprintf(&tmp, "%s", 914 call_program_and_get_last_line_of_output 915 ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2")); 912 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2")); 916 913 if (atol(tmp) < 35000) { 917 914 retval++; … … 984 981 run_program_and_log_output 985 982 ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 986 mr_asprintf(&tmp, "%s", 987 call_program_and_get_last_line_of_output 988 ("mount | grep -E \"cdr(om|w)\"")); 983 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output("mount | grep -E \"cdr(om|w)\"")); 989 984 if (strcmp("", tmp)) { 990 985 if (strstr(tmp, "autofs")) { … … 1067 1062 assert_string_is_neither_NULL_nor_zerolength(label); 1068 1063 if (!does_file_exist(config_file)) { 1069 mr_asprintf(&tmp, "(read_cfg_var) Cannot find %s config file", 1070 config_file); 1064 mr_asprintf(&tmp, "(read_cfg_var) Cannot find %s config file", config_file); 1071 1065 log_to_screen(tmp); 1072 1066 mr_free(tmp); … … 1078 1072 return (0); 1079 1073 } else { 1080 mr_asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", 1081 label, config_file); 1074 mr_asprintf(&command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file); 1082 1075 strcpy(value, call_program_and_get_last_line_of_output(command)); 1083 1076 mr_free(command); … … 1207 1200 g_boot_mountpt[0] = '\0'; 1208 1201 log_msg(4, "Done. Great. Seeting command to something"); 1209 mr_asprintf(&command, "%s", 1210 "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1202 mr_asprintf(&command, "grep -v \":\" /etc/fstab | grep -vE '^#.*$' | grep -E \"[ ]/boot[ ]\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1211 1203 log_msg(4, "Cool. Command = '%s'", command); 1212 1204 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); … … 1218 1210 mr_asprintf(&command, "mount | grep -Ew '/boot'"); 1219 1211 mr_free(tmp); 1220 mr_asprintf(&tmp, call_program_and_get_last_line_of_output(command));1212 mr_asprintf(&tmp, "%s", call_program_and_get_last_line_of_output(command)); 1221 1213 mr_free(command); 1222 1214 … … 1235 1227 strcpy(g_boot_mountpt, tmp); 1236 1228 mr_free(tmp); 1237 mr_asprintf(&tmp, 1238 "%s (your /boot partition) is not mounted. I'll mount it before backing up", 1239 g_boot_mountpt); 1229 mr_asprintf(&tmp, "%s (your /boot partition) is not mounted. I'll mount it before backing up", g_boot_mountpt); 1240 1230 log_it(tmp); 1241 1231 mr_free(tmp); … … 1304 1294 assert(value != NULL); 1305 1295 if (!does_file_exist(config_file)) { 1306 mr_asprintf(&tmp, "(write_cfg_file) Cannot find %s config file", 1307 config_file); 1296 mr_asprintf(&tmp, "(write_cfg_file) Cannot find %s config file", config_file); 1308 1297 log_to_screen(tmp); 1309 1298 mr_free(tmp); … … 1312 1301 mr_asprintf(&tempfile, "%s/mojo-jojo.blah", bkpinfo->tmpdir); 1313 1302 if (does_file_exist(config_file)) { 1314 mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s", 1315 label, config_file, tempfile); 1303 mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s", label, config_file, tempfile); 1316 1304 paranoid_system(command); 1317 1305 mr_free(command);
Note:
See TracChangeset
for help on using the changeset viewer.