Bob Mottram 8 年前
父节点
当前提交
a3fd4c4043
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 20 次插入33 次删除
  1. 20
    33
      src/freedombone-app-blogstatic

+ 20
- 33
src/freedombone-app-blogstatic 查看文件

@@ -171,45 +171,36 @@ function mesh_install_blogstatic {
171 171
         return
172 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 174
     chroot "$rootdir" apt-get -y install python-pip
183 175
     chroot "$rootdir" pip install ipython
184 176
     chroot "$rootdir" pip install Markdown
185 177
     chroot "$rootdir" pip install typogrify
186 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 183
     if [ ! -d $rootdir$STATIC_BLOG_INSTALL_DIR ]; then
189 184
         mkdir -p $rootdir$STATIC_BLOG_INSTALL_DIR
190 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 187
     if [ ! -d $rootdir$STATIC_BLOG_PATH ]; then
197 188
         mkdir -p $rootdir$STATIC_BLOG_PATH
198 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 199
     git clone --recursive $PELICAN_THEMES_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/themes
210 200
     git clone --recursive $PELICAN_PLUGINS_REPO $rootdir$STATIC_BLOG_INSTALL_DIR/plugins
211 201
 
212 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 206
 function install_blogstatic {
@@ -222,40 +213,36 @@ function install_blogstatic {
222 213
         return
223 214
     fi
224 215
 
225
-    STATIC_BLOG_INSTALL_DIR=/etc/blog
226
-    STATIC_BLOG_PATH=/var/www/$STATIC_BLOG_DOMAIN/htdocs
227
-
228 216
     apt-get -y install python-pip
229 217
     pip install ipython
230 218
     pip install Markdown
231 219
     pip install typogrify
232 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 225
     if [ ! -d $STATIC_BLOG_INSTALL_DIR ]; then
235 226
         mkdir -p $STATIC_BLOG_INSTALL_DIR
236 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 229
     if [ ! -d $STATIC_BLOG_PATH ]; then
243 230
         mkdir -p $STATIC_BLOG_PATH
244 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 241
     git clone --recursive $PELICAN_THEMES_REPO $STATIC_BLOG_INSTALL_DIR/themes
256 242
     git clone --recursive $PELICAN_PLUGINS_REPO $STATIC_BLOG_INSTALL_DIR/plugins
257 243
 
258 244
     chown -R $MY_USERNAME:$MY_USERNAME $STATIC_BLOG_INSTALL_DIR
245
+    chown -R www-data:www-data $STATIC_BLOG_PATH
259 246
 
260 247
     echo 'install_blogstatic' >> $COMPLETION_FILE
261 248
 }