diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index f0c067db6..1805d5db9 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -8477,6 +8477,8 @@ namespace oam ******************************************************************************************/ std::string Oam::updateFstab(std::string device, std::string dbrootID) { + writeLog("updateFstab called: " + device + ":" + dbrootID, LOG_TYPE_INFO ); + //check if entry already exist string cmd = "grep /data" + dbrootID + " /etc/fstab /dev/null 2>&1"; int status = system(cmd.c_str()); diff --git a/procmon/processmonitor.cpp b/procmon/processmonitor.cpp index 7e86bf03e..69d3d6a1c 100644 --- a/procmon/processmonitor.cpp +++ b/procmon/processmonitor.cpp @@ -1714,6 +1714,12 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO string entry; msg >> entry; + //check if entry already exist + string cmd = "grep " + entry + " /etc/fstab /dev/null 2>&1"; + int status = system(cmd.c_str()); + if (WEXITSTATUS(status) == 0 ) + break; + string cmd = "echo " + entry + " >> /etc/fstab"; system(cmd.c_str());