Browse Source

Remove previous blog content when creating new identity

Bob Mottram 8 years ago
parent
commit
ce30f1680f
No account linked to committer's email
1 changed files with 12 additions and 2 deletions
  1. 12
    2
      src/freedombone-image-mesh

+ 12
- 2
src/freedombone-image-mesh View File

@@ -755,7 +755,6 @@ function setup_ipfs {
755 755
     IPFS_PUBLIC=/home/$MY_USERNAME/.ipfs-public
756 756
 
757 757
     su -c "systemctl --user enable ipfs" - $MY_USERNAME
758
-    su -c "systemctl --user start ipfs" - $MY_USERNAME
759 758
 
760 759
     if [ -f $CURRENT_BLOG_INDEX ]; then
761 760
         shred -zu $CURRENT_BLOG_INDEX
@@ -766,9 +765,20 @@ function setup_ipfs {
766 765
         rm -rf /home/$MY_USERNAME/Public
767 766
     fi
768 767
 
768
+    if [ -d /home/$MY_USERNAME/CreateBlog/content ]; then
769
+        shred -zu /home/$MY_USERNAME/CreateBlog/content/*
770
+    fi
771
+
769 772
     if [ -d /home/$MY_USERNAME/.ipfs ]; then
770 773
         shred -zu /home/$MY_USERNAME/.ipfs/config
771 774
         rm -rf /home/$MY_USERNAME/.ipfs
775
+        su -c "systemctl --user restart ipfs" - $MY_USERNAME
776
+    else
777
+        su -c "systemctl --user start ipfs" - $MY_USERNAME
778
+    fi
779
+
780
+    if [ -f /home/$MY_USERNAME/.blog-index ]; then
781
+        shred -zu /home/$MY_USERNAME/.blog-index
772 782
     fi
773 783
 
774 784
     if [ -f /home/$MY_USERNAME/.ipfs-id ]; then
@@ -862,7 +872,7 @@ if [ -f $MESH_INSTALL_SETUP ]; then
862 872
 
863 873
     if [ ! $set_new_identity ]; then
864 874
         # sleep in order to allow other daemons to start up
865
-        sleep 15
875
+        sleep 5
866 876
     fi
867 877
 
868 878
     # clear the install log