From 00aceb29469c0f77fbaca4821aacdaa66571ae79 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sun, 5 Mar 2017 21:05:03 +0000
Subject: [PATCH] Sequence

---
 src/freedombone-app-tahoelafs | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/freedombone-app-tahoelafs b/src/freedombone-app-tahoelafs
index 25fe3b8d1..bb4b3ff7f 100755
--- a/src/freedombone-app-tahoelafs
+++ b/src/freedombone-app-tahoelafs
@@ -283,7 +283,7 @@ function create_tahoelafs_daemon {
     daemon_name=$1
 
     TAHOELAFS_DAEMON_FILE=/etc/systemd/system/tahoelafs_${daemon_name}.service
-    echo "$TAHOELAFS_DAEMON_FILE"
+    echo "Creating daemon: $TAHOELAFS_DAEMON_FILE"
 
     echo '[Unit]' > $TAHOELAFS_DAEMON_FILE
     echo "Description=Tahoe-LAFS ${daemon_name}" >> $TAHOELAFS_DAEMON_FILE
@@ -348,16 +348,6 @@ function install_tahoelafs {
         exit 62831
     fi
 
-    if [ ! -d /home/tahoelafs/storage ]; then
-        mkdir /home/tahoelafs/storage
-    fi
-    create_tahoelafs_storage_node /home/tahoelafs/storage "$(get_tahoelafs_introducer)"
-    TAHOELAFS_STORAGE_CONFIG=/home/tahoelafs/storage/tahoe.cfg
-    if [ ! -f $TAHOELAFS_STORAGE_CONFIG ]; then
-        echo $'Unable to create storage node'
-        exit 782523
-    fi
-
     # create an onion address
     TAHOELAFS_ONION_HOSTNAME=$(add_onion_service tahoelafs ${TAHOELAFS_PORT} ${TAHOELAFS_ONION_PORT})
 
@@ -369,11 +359,21 @@ function install_tahoelafs {
         echo $'Introducer file not found'
         exit 9654845
     fi
-    create_tahoelafs_daemon introducer
+    create_tahoelafs_daemon "introducer"
 
     # start the storage node
+    if [ ! -d /home/tahoelafs/storage ]; then
+        mkdir /home/tahoelafs/storage
+    fi
+    create_tahoelafs_storage_node /home/tahoelafs/storage "$(get_tahoelafs_introducer)"
+    TAHOELAFS_STORAGE_CONFIG=/home/tahoelafs/storage/tahoe.cfg
+    if [ ! -f $TAHOELAFS_STORAGE_CONFIG ]; then
+        echo $'Unable to create storage node'
+        exit 782523
+    fi
+
     su -c '/home/tahoelafs/tahoelafs/venv/bin/python2 /home/tahoelafs/tahoelafs/venv/bin/tahoe start /home/tahoelafs/storage' - tahoelafs
-    create_tahoelafs_daemon storage
+    create_tahoelafs_daemon "storage"
 
     set_completion_param "tahoelafs commit" "$TAHOELAFS_COMMIT"
 
-- 
GitLab