Bob Mottram пре 10 година
родитељ
комит
340ae2712e
1 измењених фајлова са 38 додато и 4 уклоњено
  1. 38
    4
      install-freedombone.sh

+ 38
- 4
install-freedombone.sh Прегледај датотеку

@@ -64,6 +64,8 @@ MY_USERNAME=$2
64 64
 FREEDNS_SUBDOMAIN_CODE=$3
65 65
 SYSTEM_TYPE=$4
66 66
 
67
+# Different system variants which may be specified within
68
+# the SYSTEM_TYPE option
67 69
 VARIANT_WRITER="writer"
68 70
 VARIANT_CLOUD="cloud"
69 71
 VARIANT_CHAT="chat"
@@ -93,11 +95,18 @@ WIKI_DOMAIN_NAME=
93 95
 WIKI_ARCHIVE="dokuwiki-stable.tgz"
94 96
 WIKI_DOWNLOAD="http://download.dokuwiki.org/src/dokuwiki/$WIKI_ARCHIVE"
95 97
 WIKI_HASH="a0e79986b87b2744421ce3c33b43a21f296deadd81b1789c25fa4bb095e8e470"
98
+
96 99
 # see https://www.dokuwiki.org/template:mnml-blog
97 100
 WIKI_MNML_BLOG_ADDON_ARCHIVE="mnml-blog.tar.gz"
98 101
 WIKI_MNML_BLOG_ADDON="https://andreashaerter.com/downloads/dokuwiki-template-mnml-blog/latest"
99 102
 WIKI_MNML_BLOG_ADDON_HASH="428c280d09ee14326fef5cd6f6772ecfcd532f7b6779cd992ff79a97381cf39f"
100 103
 
104
+# see https://www.dokuwiki.org/plugin:blogtng
105
+WIKI_BLOGTNG_ADDON_NAME="dokufreaks-plugin-blogtng-93a3fec"
106
+WIKI_BLOGTNG_ADDON_ARCHIVE="$WIKI_BLOGTNG_ADDON_NAME.zip"
107
+WIKI_BLOGTNG_ADDON="https://github.com/dokufreaks/plugin-blogtng/zipball/master"
108
+WIKI_BLOGTNMG_ADDON_HASH="212b3ad918fdc92b2d49ef5d36bc9e086eab27532931ba6b87e05f35fd402a27"
109
+
101 110
 GPG_KEYSERVER="hkp://keys.gnupg.net"
102 111
 
103 112
 # optionally you can provide your exported GPG key pair here
@@ -2025,23 +2034,48 @@ function install_blog {
2025 2034
   if grep -Fxq "install_blog" $COMPLETION_FILE; then
2026 2035
       return
2027 2036
   fi
2037
+  if [ ! -f $WIKI_DOMAIN_NAME ]; then
2038
+      return
2039
+  fi
2028 2040
 
2041
+  # download mnml-blog
2029 2042
   cd $INSTALL_DIR
2030 2043
   rm -f latest
2031 2044
   wget $WIKI_MNML_BLOG_ADDON
2032 2045
   if [ ! -f "$INSTALL_DIR/latest" ]; then
2033
-	  echo 'Dokuwiki mnml-blog addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_MNML_BLOG_ADDON at the top of this script as needed.'
2034
-	  exit 21
2046
+      echo 'Dokuwiki mnml-blog addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_MNML_BLOG_ADDON at the top of this script as needed.'
2047
+      exit 21
2035 2048
   fi
2036 2049
   mv latest $WIKI_MNML_BLOG_ADDON_ARCHIVE
2037 2050
 
2038
-  # Check that the hash is correct
2051
+  # Check that the mnml-blog download hash is correct
2039 2052
   CHECKSUM=$(sha256sum $WIKI_MNML_BLOG_ADDON_ARCHIVE | awk -F ' ' '{print $1}')
2040 2053
   if [[ $CHECKSUM != $WIKI_MNML_BLOG_ADDON_HASH ]]; then
2041 2054
       echo 'The sha256 hash of the mnml-blog download is incorrect. Possibly the file may have been tampered with. Check the hash on the Dokuwiki mnmlblog web site and alter WIKI_MNML_BLOG_ADDON_HASH if needed.'
2042 2055
       exit 22
2043 2056
   fi
2044 2057
 
2058
+  # download blogTNG
2059
+  wget $WIKI_BLOGTNG_ADDON
2060
+  if [ ! -f "$INSTALL_DIR/master" ]; then
2061
+      echo 'Dokuwiki blogTNG addon could not be downloaded. Check the Dokuwiki web site and alter WIKI_BLOGTNG_ADDON at the top of this script as needed.'
2062
+      exit 23
2063
+  fi
2064
+  mv master $WIKI_BLOGTNG_ADDON_ARCHIVE
2065
+
2066
+  # Check that the blogTNG hash is correct
2067
+  CHECKSUM=$(sha256sum $WIKI_BLOGTNG_ADDON_ARCHIVE | awk -F ' ' '{print $1}')
2068
+  if [[ $CHECKSUM != $WIKI_BLOGTNG_ADDON_HASH ]]; then
2069
+      echo 'The sha256 hash of the blogTNG download is incorrect. Possibly the file may have been tampered with. Check the hash on the Dokuwiki blogTNG web site and alter WIKI_BLOGTNG_ADDON_HASH if needed.'
2070
+      exit 24
2071
+  fi
2072
+
2073
+  # install blogTNG
2074
+  unzip $WIKI_BLOGTNG_ADDON_ARCHIVE
2075
+  mv $WIKI_BLOGTNG_ADDON_NAME blogtng
2076
+  cp blogtng /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/plugins/
2077
+
2078
+  # install mnml-blog
2045 2079
   tar -xzvf $WIKI_MNML_BLOG_ADDON_ARCHIVE
2046 2080
   cp mnml-blog /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/
2047 2081
   cp -r /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/tpl/mnml-blog/blogtng-tpl/* /var/www/$WIKI_DOMAIN_NAME/htdocs/lib/plugins/blogtng/tpl/default/
@@ -2108,7 +2142,7 @@ configure_firewall_for_xmpp
2108 2142
 install_irc_server
2109 2143
 configure_firewall_for_irc
2110 2144
 install_wiki
2111
-#install_blog
2145
+install_blog
2112 2146
 install_final
2113 2147
 echo 'Freedombone installation is complete'
2114 2148
 exit 0