Bob Mottram 8 år sedan
förälder
incheckning
a3fd4c4043
No account linked to committer's email
1 ändrade filer med 20 tillägg och 33 borttagningar
  1. 20
    33
      src/freedombone-app-blogstatic

+ 20
- 33
src/freedombone-app-blogstatic Visa fil

171
         return
171
         return
172
     fi
172
     fi
173
 
173
 
174
-    if [ ! -d $rootdir/home/$MY_USERNAME/Public/Blog ]; then
175
-        mkdir -p $rootdir/home/$MY_USERNAME/Public/Blog
176
-        chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Public
177
-    fi
178
-
179
-    STATIC_BLOG_INSTALL_DIR=/home/$MY_USERNAME/CreateBlog
180
-    STATIC_BLOG_PATH=/home/$MY_USERNAME/Public/Blog
181
-
182
     chroot "$rootdir" apt-get -y install python-pip
174
     chroot "$rootdir" apt-get -y install python-pip
183
     chroot "$rootdir" pip install ipython
175
     chroot "$rootdir" pip install ipython
184
     chroot "$rootdir" pip install Markdown
176
     chroot "$rootdir" pip install Markdown
185
     chroot "$rootdir" pip install typogrify
177
     chroot "$rootdir" pip install typogrify
186
     chroot "$rootdir" pip install pelican
178
     chroot "$rootdir" pip install pelican
187
 
179
 
180
+    STATIC_BLOG_INSTALL_DIR=/home/$MY_USERNAME/CreateBlog
181
+    STATIC_BLOG_PATH=/home/$MY_USERNAME/Public/Blog
182
+
188
     if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR ]; then
183
     if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR ]; then
189
         mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR
184
         mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR
190
     fi
185
     fi
191
 
186
 
192
-    if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content ]; then
193
-        mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content
194
-    fi
195
-
196
     if [ ! -d $rootdir$STATIC_BLOG_PATH ]; then
187
     if [ ! -d $rootdir$STATIC_BLOG_PATH ]; then
197
         mkdir -p $rootdir$STATIC_BLOG_PATH
188
         mkdir -p $rootdir$STATIC_BLOG_PATH
198
     fi
189
     fi
199
 
190
 
200
-    STATIC_BLOG_FILE=$rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
201
-    create_pelican_conf $STATIC_BLOG_FILE
202
-
203
-    STATIC_BLOG_FILE=$rootdir$STATIC_BLOG_INSTALL_DIR/Makefile
204
-    create_pelican_makefile $STATIC_BLOG_FILE
191
+    if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR/content ]; then
192
+        mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR/content
193
+    fi
205
 
194
 
206
-    STATIC_BLOG_FILE=$rootdir$STATIC_BLOG_INSTALL_DIR/publishconf.py
207
-    create_pelican_publish_conf $STATIC_BLOG_FILE
195
+    create_pelican_conf $rootdir$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
196
+    create_pelican_makefile $rootdir$STATIC_BLOG_INSTALL_DIR/Makefile
197
+    create_pelican_publish_conf $STATIC_BLOG_INSTALL_DIR/publishconf.py
208
 
198
 
209
     git clone --recursive $PELICAN_THEMES_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/themes
199
     git clone --recursive $PELICAN_THEMES_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/themes
210
     git clone --recursive $PELICAN_PLUGINS_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/plugins
200
     git clone --recursive $PELICAN_PLUGINS_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/plugins
211
 
201
 
212
     chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
202
     chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
203
+    chroot "$rootdir" chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Public
213
 }
204
 }
214
 
205
 
215
 function install_blogstatic {
206
 function install_blogstatic {
222
         return
213
         return
223
     fi
214
     fi
224
 
215
 
225
-    STATIC_BLOG_INSTALL_DIR=/etc/blog
226
-    STATIC_BLOG_PATH=/var/www/$STATIC_BLOG_DOMAIN/htdocs
227
-
228
     apt-get -y install python-pip
216
     apt-get -y install python-pip
229
     pip install ipython
217
     pip install ipython
230
     pip install Markdown
218
     pip install Markdown
231
     pip install typogrify
219
     pip install typogrify
232
     pip install pelican
220
     pip install pelican
233
 
221
 
222
+    STATIC_BLOG_INSTALL_DIR=/etc/blog
223
+    STATIC_BLOG_PATH=/var/www/$STATIC_BLOG_DOMAIN/htdocs
224
+
234
     if [ ! -d $STATIC_BLOG_INSTALL_DIR ]; then
225
     if [ ! -d $STATIC_BLOG_INSTALL_DIR ]; then
235
         mkdir -p $STATIC_BLOG_INSTALL_DIR
226
         mkdir -p $STATIC_BLOG_INSTALL_DIR
236
     fi
227
     fi
237
 
228
 
238
-    if [ ! -d $STATIC_BLOG_INSTALL_DIR/content ]; then
239
-        mkdir -p $STATIC_BLOG_INSTALL_DIR/content
240
-    fi
241
-
242
     if [ ! -d $STATIC_BLOG_PATH ]; then
229
     if [ ! -d $STATIC_BLOG_PATH ]; then
243
         mkdir -p $STATIC_BLOG_PATH
230
         mkdir -p $STATIC_BLOG_PATH
244
     fi
231
     fi
245
 
232
 
246
-    STATIC_BLOG_FILE=$STATIC_BLOG_INSTALL_DIR/pelicanconf.py
247
-    create_pelican_conf $STATIC_BLOG_FILE
248
-
249
-    STATIC_BLOG_FILE=$STATIC_BLOG_INSTALL_DIR/Makefile
250
-    create_pelican_makefile $STATIC_BLOG_FILE
233
+    if [ ! -d $STATIC_BLOG_INSTALL_DIR/content ]; then
234
+        mkdir -p $STATIC_BLOG_INSTALL_DIR/content
235
+    fi
251
 
236
 
252
-    STATIC_BLOG_FILE=$STATIC_BLOG_INSTALL_DIR/publishconf.py
253
-    create_pelican_publish_conf $STATIC_BLOG_FILE
237
+    create_pelican_conf $STATIC_BLOG_INSTALL_DIR/pelicanconf.py
238
+    create_pelican_makefile $STATIC_BLOG_INSTALL_DIR/Makefile
239
+    create_pelican_publish_conf $STATIC_BLOG_INSTALL_DIR/publishconf.py
254
 
240
 
255
     git clone --recursive $PELICAN_THEMES_REPO $STATIC_BLOG_INSTALL_DIR/themes
241
     git clone --recursive $PELICAN_THEMES_REPO $STATIC_BLOG_INSTALL_DIR/themes
256
     git clone --recursive $PELICAN_PLUGINS_REPO $STATIC_BLOG_INSTALL_DIR/plugins
242
     git clone --recursive $PELICAN_PLUGINS_REPO $STATIC_BLOG_INSTALL_DIR/plugins
257
 
243
 
258
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
244
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
245
+    chown -R www-data:www-data $STATIC_BLOG_PATH
259
 
246
 
260
     echo 'install_blogstatic' >> $COMPLETION_FILE
247
     echo 'install_blogstatic' >> $COMPLETION_FILE
261
 }
248
 }