[PC-BSD Commits] r4928 - in pcbsd/trunk/lifePreserver: . scripts

svn at pcbsd.org svn at pcbsd.org
Mon Nov 9 16:08:36 PST 2009


Author: kris
Date: 2009-11-09 16:08:35 -0800 (Mon, 09 Nov 2009)
New Revision: 4928

Added:
   pcbsd/trunk/lifePreserver/lifePreserverSettings.ui
Modified:
   pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp
   pcbsd/trunk/lifePreserver/lifePreserverWizard.ui
   pcbsd/trunk/lifePreserver/scripts/backup-rsync.sh
   pcbsd/trunk/lifePreserver/scripts/setup-ssh-keys.sh
Log:

Added .ui file for editing settings of a life-preserver, also started adding support for setting a custom SSH port



Modified: pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp
===================================================================
--- pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp	2009-11-09 21:08:42 UTC (rev 4927)
+++ pcbsd/trunk/lifePreserver/lifePreserverWizard.cpp	2009-11-10 00:08:35 UTC (rev 4928)
@@ -120,10 +120,12 @@
   if ( ! doesPreserverExist() )
   {
     setEnabled(false);
+    QString tmpPort;
+    tmpPort.setNum(spinPort->value());
     QString program = "xterm";
     QStringList arguments;
     arguments << "-e" << LIFEPRESERVERPATH + "/scripts/setup-ssh-keys.sh " \
-    + lineUserName->text() + " " + lineHostName->text();
+    + lineUserName->text() + " " + lineHostName->text() + " " + tmpPort;
 
     qDebug() << program << arguments;
     QProcess *sshAuthProc = new QProcess(this);
@@ -163,7 +165,7 @@
    QString connectString = lineUserName->text() + "@" + lineHostName->text();
    PRESERVER myPreserver(connectString);
    myPreserver.setHost(connectString);
-   myPreserver.setPort(22);
+   myPreserver.setPort(spinPort->value());
    myPreserver.setType("rsync");
    myPreserver.setNumBackups(7);
 

Modified: pcbsd/trunk/lifePreserver/lifePreserverWizard.ui
===================================================================
--- pcbsd/trunk/lifePreserver/lifePreserverWizard.ui	2009-11-09 21:08:42 UTC (rev 4927)
+++ pcbsd/trunk/lifePreserver/lifePreserverWizard.ui	2009-11-10 00:08:35 UTC (rev 4928)
@@ -125,9 +125,9 @@
     <item row="1" column="0">
      <widget class="QGroupBox" name="groupBox_3">
       <property name="title">
-       <string>Device information</string>
+       <string>Server information</string>
       </property>
-      <layout class="QGridLayout" name="gridLayout_4">
+      <layout class="QGridLayout" name="gridLayout_3">
        <item row="0" column="0">
         <layout class="QHBoxLayout" name="horizontalLayout_8">
          <item>
@@ -156,6 +156,33 @@
          </item>
         </layout>
        </item>
+       <item row="2" column="0">
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="label_4">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>SSH Port</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSpinBox" name="spinPort">
+           <property name="maximum">
+            <number>999999</number>
+           </property>
+           <property name="value">
+            <number>22</number>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
       </layout>
      </widget>
     </item>

Modified: pcbsd/trunk/lifePreserver/scripts/backup-rsync.sh
===================================================================
--- pcbsd/trunk/lifePreserver/scripts/backup-rsync.sh	2009-11-09 21:08:42 UTC (rev 4927)
+++ pcbsd/trunk/lifePreserver/scripts/backup-rsync.sh	2009-11-10 00:08:35 UTC (rev 4928)
@@ -17,7 +17,7 @@
 EXCLUDELIST="/PCBSD/lifePreserver/conf/rsync-excludes"
 PIDFILE="${HOSTDIR}/preserver.pid"
 RESULTFILE="${HOSTDIR}/last-result"
-STARTDATE=`date "+%H:%M %Y-%m-%d"`
+STARTDATE=`date "+%H:%M %m-%d-%y"`
 
 # Source our functions
 . ${PROGDIR}/scripts/functions.sh

Modified: pcbsd/trunk/lifePreserver/scripts/setup-ssh-keys.sh
===================================================================
--- pcbsd/trunk/lifePreserver/scripts/setup-ssh-keys.sh	2009-11-09 21:08:42 UTC (rev 4927)
+++ pcbsd/trunk/lifePreserver/scripts/setup-ssh-keys.sh	2009-11-10 00:08:35 UTC (rev 4928)
@@ -4,6 +4,7 @@
 
 SSHUSER=$1
 SSHHOST=$2
+SSHPORT=$3
 
 if [ -z "${SSHUSER}" -o -z "${SSHHOST}" ]
 then
@@ -33,7 +34,7 @@
 # Get the .pub key
 PUBKEY="`cat .ssh/id_rsa.pub`"
 
-ssh ${SSHUSER}@${SSHHOST} "mkdir .ssh ; echo $PUBKEY >> .ssh/authorized_keys; chmod 600 .ssh/authorized_keys ; echo $PUBKEY >> .ssh/authorized_keys2; chmod 600 .ssh/authorized_keys2"
+ssh -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "mkdir .ssh ; echo $PUBKEY >> .ssh/authorized_keys; chmod 600 .ssh/authorized_keys ; echo $PUBKEY >> .ssh/authorized_keys2; chmod 600 .ssh/authorized_keys2"
 
 if [ "$?" != "0" ]
 then



More information about the Commits mailing list