Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Fix copying files to USB stick
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed Aug 21, 2013
1 parent e913299 commit f9da465
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src-qt4/life-preserver/LPBackend.cpp
Expand Up @@ -343,7 +343,7 @@ QStringList LPBackend::findValidUSBDevices(){
//Now process the output
QStringList list;
for(int i=0; i<out.length(); i++){
if(out[i].startsWith("/dev/da") && out[i].contains("(msdosfs,local)")){
if(out[i].startsWith("/dev/da") && out[i].contains("(msdosfs,")){
QString mountpoint = out[i].section(" on ",1,1).section("(",0,0).simplified();
QString devnode = out[i].section(" on ",0,0).section("/",-1).simplified();
list << mountpoint +" ("+devnode+")";
Expand All @@ -353,10 +353,15 @@ QStringList LPBackend::findValidUSBDevices(){
}

bool LPBackend::copySSHKey(QString mountPath, QString localHost){
QString publicKey = "/root/.ssh/id_rsa.pub";
QString publicKey = "/root/.ssh/id_rsa";
//copy the file onto the designated USB stick
if(!mountPath.endsWith("/")){ mountPath.append("/"); }
mountPath.append("root/.ssh/"+localHost+"-id_rsa.pub");
QDir lDir=mountPath + "lpreserver";
if ( ! lDir.exists() )
lDir.mkdir(lDir.path());

mountPath.append("lpreserver/"+localHost+"-id_rsa");

bool ok = QFile::copy(publicKey, mountPath);
return ok;
}

0 comments on commit f9da465

Please sign in to comment.