Prechádzať zdrojové kódy

Add and update scripts
Add scripts for local use (based on rsync), change root directory to home directory, and add more exclude flags.

poesty 1 rok pred
rodič
commit
bbb4bfa716

+ 1 - 1
update/update_librex.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-cd /root/librex
+cd $HOME/librex
 git fetch origin main -n --quiet
 git diff --quiet HEAD FETCH_HEAD && echo "Up-to-date" && exit
 git pull --quiet

+ 2 - 2
update/update_mangane.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
-cd /root
+cd $HOME
 curl -L https://github.com/BDX-town/Mangane/releases/latest/download/static.zip -o mangane.zip
 unzip mangane.zip
-lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev dist/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X favicon.ico"
+lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev dist/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X favicon.ico -X robots.txt"
 rm -r dist/ mangane.zip

+ 6 - 0
update/update_mangane_local.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+web_path=""
+curl -L https://github.com/BDX-town/Mangane/releases/latest/download/static.zip -o "$web_path/mangane.zip"
+unzip "$web_path/mangane.zip" -d "$web_path/mangane"
+rsync -avh --delete --exclude=".htaccess" --exclude="favicon.ico" --exclude="robots.txt" "$web_path/mangane/dist/" "$web_path/public_html"
+rm -r "$web_path/mangane.zip" "$web_path/mangane"

+ 2 - 2
update/update_mdbook.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-cd /root/BookStack2Site/ && rm -r book-test/src/ book-test/book/
+cd $HOME/BookStack2Site/ && rm -r book-test/src/ book-test/book/
 BookStackEndpoint=""
 BookStackAPITokenID=
 BookStackAPITokenSecret=
@@ -9,7 +9,7 @@ bin/bookstack2site --bookstack-url=${BookStackEndpoint} --token-id=${BookStackAP
 # convert markup to mdbook-admonish
 # success label is not supported
 # mdbook-regex is also suggested
-cd book-test 
+cd book-test
 find . -name "*.md" -exec sed -i 's/<p class="callout info">\(.*\)<\/p>/```admonish info\n\1\n```/g' {} +
 find . -name "*.md" -exec sed -i 's/<p class="callout warning">\(.*\)<\/p>/```admonish warning\n\1\n```/g' {} +
 find . -name "*.md" -exec sed -i 's/<p class="callout danger">\(.*\)<\/p>/```admonish danger\n\1\n```/g' {} +

+ 2 - 2
update/update_phanpy.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
-cd /root
+cd $HOME
 wget https://github.com/cheeaun/phanpy/releases/latest/download/phanpy-dist.zip
 unzip phanpy-dist.zip -d phanpy
-lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev phanpy/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X robots.txt"
+lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev phanpy/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess"
 rm -r phanpy/ phanpy-dist.zip

+ 6 - 0
update/update_phanpy_local.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+web_path=""
+curl -L https://github.com/cheeaun/phanpy/releases/latest/download/phanpy-dist.zip -o "$web_path/phanpy.zip"
+unzip "$web_path/phanpy.zip" -d "$web_path/phanpy"
+rsync -avh --delete --exclude=".htaccess" "$web_path/phanpy/" "$web_path/public_html"
+rm -r "$web_path/phanpy.zip" "$web_path/phanpy"

+ 1 - 1
update/update_rss-bridge.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-cd /root
+cd $HOME
 wget https://github.com/Rss-Bridge/rss-bridge/archive/master.zip
 unzip master.zip
 find rss-bridge-master/ -name "*.php" -exec sed -i "s/parse_ini_file(\([^,]*\),.*)/parse_ini_string(file_get_contents(\1), true, INI_SCANNER_TYPED)/g" {} +

+ 1 - 1
update/update_sengi.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-cd /root
+cd $HOME
 sh docker-image-extract nicolasconstant/sengi
 lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev output/app/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X robots.txt"
 rm -r output

+ 5 - 0
update/update_sengi_local.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+web_path=""
+sh $HOME/scripts/docker-image-extract -o "$web_path/sengi" nicolasconstant/sengi
+rsync -avh --delete --exclude=".htaccess" --exclude="robots.txt" "$web_path/sengi/app/" "$web_path/public_html"
+rm -rf "$web_path/sengi"

+ 1 - 1
update/update_soapbox.sh

@@ -2,5 +2,5 @@
 cd /root
 wget https://dl.soapbox.pub/main/soapbox.zip
 unzip soapbox.zip -d soapbox
-lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev soapbox/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X favicon.ico"
+lftp -c "set ssl:verify-certificate no; open ftp://[REDACTED]; mirror -Rev soapbox/ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X favicon.ico -X robots.txt"
 rm -r soapbox/ soapbox.zip

+ 6 - 0
update/update_soapbox_local.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+web_path=""
+curl -L https://dl.soapbox.pub/main/soapbox.zip -o "$web_path/soapbox.zip"
+unzip "$web_path/soapbox.zip" -d "$web_path/soapbox"
+rsync -avh --delete --exclude=".htaccess" --exclude="favicon.ico" --exclude="robots.txt" "$web_path/soapbox/" "$web_path/public_html"
+rm -r "$web_path/soapbox.zip" "$web_path/soapbox"