sync-web/sync.sh

72 行
3.5 KiB
Bash
Raw 通常表示 履歴

2022-12-07 23:31:47 +09:00
#!/bin/sh
IPPAN=192.168.0.1
DARK=192.168.0.2
TILDE=technicalsuwako@tilde.club
# 画像など
2023-05-31 11:45:19 +09:00
rsync -rtvzP ass ${IPPAN}:/var/www/htdocs/technicalsuwako.moe
rsync -rtvzP ass ${DARK}:/var/www/htdocs/technicalsuwako.moe
2022-12-07 23:31:47 +09:00
# ウエブサイト
## 一般ネット
### HTTP
2023-05-31 11:45:19 +09:00
rsync -rtvzP www ${IPPAN}:/var/www/htdocs/technicalsuwako.moe
2022-12-07 23:31:47 +09:00
### Gemini
2023-05-31 11:45:19 +09:00
cp www/blog.atom gemini
cp www/twtxt.txt gemini
cd gemini
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/technicalsuwako\.moe/gemini:\/\/technicalsuwako\.moe/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/\/<\/id>/\.gmi<\/id>/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/\/" rel="alt/\.gmi" rel="alt/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/\/*$//' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/blog\/.*/blog\/\0\.gmi/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/gemini:\/\/technicalsuwako\.moe/g' {} +
cd ..
rsync -rtvzP gemini/* ${IPPAN}:/var/gemini/technicalsuwako.moe
2022-12-07 23:31:47 +09:00
## ダークネット
rm -rf tor i2p public_html
cp -r www tor
cp -r www i2p
### Tor
cd tor
find . -type f -name "*.html" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd\.onion/g' {} +
find . -type f -name "*.html" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
find . -type f -name "*.html" -exec sed -i 's/https:\/\/stopsdgs\.076\.moe/http:\/\/stopsdgs\.7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
2022-12-14 07:36:02 +09:00
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd\.onion/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
2023-02-07 10:38:34 +09:00
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
2022-12-07 23:31:47 +09:00
cd ..
### I2P
cd i2p
find . -type f -name "*.html" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.technicalsuwako\.i2p/g' {} +
find . -type f -name "*.html" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} +
2022-12-14 07:36:02 +09:00
find . -type f -name "*.html" -exec sed -i 's/https:\/\/stopsdgs\.076\.moe/http:\/\/stopsdgs\.076\.i2p/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.technicalsuwako\.i2p/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} +
2023-02-07 10:38:34 +09:00
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/http:\/\/technicalsuwako\.i2p/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} +
2022-12-07 23:31:47 +09:00
cd ..
### 両方同期
2023-05-31 11:45:19 +09:00
rsync -rtvzP tor ${DARK}:/var/www/htdocs/technicalsuwako.moe
rsync -rtvzP i2p ${DARK}:/var/www/htdocs/technicalsuwako.moe
2022-12-07 23:31:47 +09:00
## ティルデ
cp -r www public_html
cd public_html
find . -type f -name "*.html" -exec sed -i 's/href="\//href="\/\~technicalsuwako\//g' {} +
find . -type f -name "*.html" -exec sed -i 's/src="\//src="\/\~technicalsuwako\//g' {} +
find . -type f -name "*.css" -exec sed -i 's/static/\~technicalsuwako\/static/g' {} +
cd ..
rsync -rtvzP public_html ${TILDE}:/home/technicalsuwako