update step 1

Change-Id: I8bfb6fabf336dda75c497fef1db602750ff7606f
diff --git a/deployment/step1.sh b/deployment/step1.sh
index 77b3115..9477af2 100755
--- a/deployment/step1.sh
+++ b/deployment/step1.sh
@@ -4,25 +4,26 @@
 read CA_PREFIX
 echo ""
 
-echo "Do you want to compile and build NDNCERT? [Y/N]"
+echo "Do you want to (re) compile and build NDNCERT? [Y/N]"
 read NDNCERT_COMPILE
 echo ""
 
 case $NDNCERT_COMPILE in
              N|n)
-                   echo "Okay, we'll continue with the setup"
+                   echo "Okay, we'll skip compilation and build."
              ;;
              Y|y)
                    cd ../ && CXXFLAGS="-O2" ./waf configure
                    ./waf
-		               echo "Need sudo to install NDNCERT CLI tools"
-		               sudo ./waf install
              ;;
              *)
                    echo "Unknown option, build and install is cancelled"
                    exit
              ;;
 esac
+echo "Need sudo to install NDNCERT CLI tools"
+sudo ./waf install
+echo ""
 
 echo "==================================================================="
 echo "=="
@@ -54,19 +55,18 @@
 echo "==================================================================="
 
 echo "Do you want to install ndncert CA for systemd on this machine? [Y/N]"
-echo ""
 read SYSTEMD_INSTALL
+echo ""
 
 case $SYSTEMD_INSTALL in
              N|n)
                    echo "We will not install systemd CA on this machine"
-                   echo ""
                    echo "Successfully finish the deployment of NDNCERT. To run NDNCERT, please use CLI ndncert-ca-server"
                    exit
              ;;
              Y|y)
                    echo "Copying NDNCERT-CA systemd service on this machine"
-		               sudo cp ../build/systemd/ndncert-ca.service /etc/systemd/system
+		               sudo cp $(pwd)/../build/systemd/ndncert-ca.service /etc/systemd/system
 		               sudo chmod 644 /etc/systemd/system/ndncert-ca.service
              ;;
              *)
@@ -75,24 +75,23 @@
              ;;
 esac
 
+echo ""
 echo "ndncert-ca service requires user ndn. Will check it now :D"
 if id ndn &>/dev/null; then
     echo 'ndn user account found, GOOD!'
-    echo ""
 else
     echo 'ndn user not found; adding ndn user as root'
-    echo ""
     sudo useradd ndn
 fi
 
-echo "ndncert-ca service requires /var/lib/ndncert-ca. Will check or create the keychain in /var/lib/ndncert-ca"
 echo ""
+echo "ndncert-ca service requires /var/lib/ndncert-ca. Will check or create the keychain in /var/lib/ndncert-ca"
 sudo mkdir -p /var/lib/ndncert-ca
 sudo chown ndn /var/lib/ndncert-ca
 echo '/var/lib/ndncert-ca is ready, GOOD!'
 
-echo "Do you want to import an exisitng safebag for ${CA_PREFIX}? [Y/N]"
 echo ""
+echo "Do you want to import an exisitng safebag for ${CA_PREFIX}? [Y/N]"
 read USE_SAFE_BAG
 
 case $USE_SAFE_BAG in
@@ -118,9 +117,13 @@
              ;;
 esac
 
+echo "Load the new configuration file for the CA"
+echo -e "{\n\"ca-prefix\": \"${CA_PREFIX}\",\n\"ca-info\": \"NDNCERT CA for ${CA_PREFIX}\",\n\"max-validity-period\": \"1296000\",\n\"max-suffix-length\": \"2\",\n\"supported-challenges\":\n[\n{ \"challenge\": \"pin\" }\n]\n}" > /usr/local/etc/ndncert/ca.conf
+echo ""
+
 echo "Do you want to start the service now? [Y/N]"
 read START_NOW
-case $USE_SAFE_BAG in
+case $START_NOW in
              N|n)
                    echo "Successfully finish the deployment of NDNCERT. You can run sudo systemctl start ndncert-ca when you want to start the service"
                    exit
@@ -128,7 +131,7 @@
              Y|y)
                    echo "Starting the service ndncert-ca"
                    sudo systemctl start ndncert-ca
-                   sleep(2)
+                   sleep 2
                    echo "Reading the status of service ndncert-ca"
                    sudo systemctl status ndncert-ca
                    echo "Successfully finish the deployment of NDNCERT. You can run sudo systemctl status ndncert-ca when you want to check the status of the service"