Kaynağa Gözat

Remove previous blog content when creating new identity

Bob Mottram 8 yıl önce
ebeveyn
işleme
ce30f1680f
No account linked to committer's email
1 değiştirilmiş dosya ile 12 ekleme ve 2 silme
  1. 12
    2
      src/freedombone-image-mesh

+ 12
- 2
src/freedombone-image-mesh Dosyayı Görüntüle

755
     IPFS_PUBLIC=/home/$MY_USERNAME/.ipfs-public
755
     IPFS_PUBLIC=/home/$MY_USERNAME/.ipfs-public
756
 
756
 
757
     su -c "systemctl --user enable ipfs" - $MY_USERNAME
757
     su -c "systemctl --user enable ipfs" - $MY_USERNAME
758
-    su -c "systemctl --user start ipfs" - $MY_USERNAME
759
 
758
 
760
     if [ -f $CURRENT_BLOG_INDEX ]; then
759
     if [ -f $CURRENT_BLOG_INDEX ]; then
761
         shred -zu $CURRENT_BLOG_INDEX
760
         shred -zu $CURRENT_BLOG_INDEX
766
         rm -rf /home/$MY_USERNAME/Public
765
         rm -rf /home/$MY_USERNAME/Public
767
     fi
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
     if [ -d /home/$MY_USERNAME/.ipfs ]; then
772
     if [ -d /home/$MY_USERNAME/.ipfs ]; then
770
         shred -zu /home/$MY_USERNAME/.ipfs/config
773
         shred -zu /home/$MY_USERNAME/.ipfs/config
771
         rm -rf /home/$MY_USERNAME/.ipfs
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
     fi
782
     fi
773
 
783
 
774
     if [ -f /home/$MY_USERNAME/.ipfs-id ]; then
784
     if [ -f /home/$MY_USERNAME/.ipfs-id ]; then
862
 
872
 
863
     if [ ! $set_new_identity ]; then
873
     if [ ! $set_new_identity ]; then
864
         # sleep in order to allow other daemons to start up
874
         # sleep in order to allow other daemons to start up
865
-        sleep 15
875
+        sleep 5
866
     fi
876
     fi
867
 
877
 
868
     # clear the install log
878
     # clear the install log