このコミットが含まれているのは:
守矢諏訪子 2023-11-13 00:08:27 +09:00
コミット 9f1c98eb22
1個のファイルの変更66行の追加29行の削除

95
sync.sh
ファイルの表示

@ -1,17 +1,20 @@
#!/bin/sh #!/bin/sh
IPPAN=192.168.0.1 SRV=192.168.10.103
DARK=192.168.0.2
TILDE=technicalsuwako@tilde.club TILDE=technicalsuwako@tilde.club
# 創作
./gostatic -v config
./gostatic -v tuifig
# 画像など # 画像など
rsync -rtvzP ass ${IPPAN}:/var/www/htdocs/technicalsuwako.moe rsync -rtvzP ass ${SRV}:/var/www/htdocs/technicalsuwako.moe
rsync -rtvzP ass ${DARK}:/var/www/htdocs/technicalsuwako.moe
# ウエブサイト # ウエブサイト
## 一般ネット ## 一般ネット
### HTTP ### HTTP
rsync -rtvzP www ${IPPAN}:/var/www/htdocs/technicalsuwako.moe rsync -rtvzP www ${SRV}:/var/www/htdocs/technicalsuwako.moe
rsync -rtvzP txt ${SRV}:/var/www/htdocs/technicalsuwako.moe
### Gemini ### Gemini
cp www/blog.atom gemini cp www/blog.atom gemini
@ -23,45 +26,64 @@ 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/\/*$//' {} +
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/blog\/.*/blog\/\0\.gmi/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/gemini:\/\/technicalsuwako\.moe/g' {} + find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/gemini:\/\/technicalsuwako\.moe/g' {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/076\.moe/gemini:\/\/076\.moe/g' {} +
cd .. cd ..
rsync -rtvzP gemini/* ${IPPAN}:/var/gemini/technicalsuwako.moe rsync -rtvzP gemini/* ${IPPAN}:/var/gemini/technicalsuwako.moe
## ダークネット ## ダークネット
rm -rf tor i2p public_html rm -rf tor i2p public_html ttor ti2p
cp -r www tor cp -r www tor
cp -r www i2p cp -r www i2p
cp -r txt ttor
cp -r txt ti2p
### Tor henko() {
cd tor local f=$1
find . -type f -name "*.html" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd\.onion/g' {} + local o=$2
find . -type f -name "*.html" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} + local n=$3
find . -type f -name "*.html" -exec sed -i 's/https:\/\/stopsdgs\.076\.moe/http:\/\/stopsdgs\.7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} +
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd\.onion/g' {} + for ex in "html" "atom" "txt"; do
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} + case $ex in
"html") fn="*.html" ;;
"atom") fn="blog.atom" ;;
"txt") fn="twtxt.txt" ;;
esac
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} + find "$f" -type f -name "$fn" -exec sed -i "s|$o|$n|g" {} +
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/076\.moe/http:\/\/7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd\.onion/g' {} + done
cd .. }
### I2P kosin() {
cd i2p local f=$1
find . -type f -name "*.html" -exec sed -i 's/https:\/\/ass\.technicalsuwako\.moe/http:\/\/ass\.technicalsuwako\.i2p/g' {} + local m=$2
find . -type f -name "*.html" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} +
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' {} + cd "$f" || exit
find . -type f -name "blog.atom" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} + while IFS= read -r line; do
henko "$f" "${line%%,*}" "${line##*,}"
done <<< "$m"
cd ..
}
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/technicalsuwako\.moe/http:\/\/technicalsuwako\.i2p/g' {} + tormap="https://ass.technicalsuwako.moe,http://ass.6qiatzlijtqo6giwvuhex5zgg3czzwrq5g6yick3stnn4xekw26zf7qd.onion
find . -type f -name "twtxt.txt" -exec sed -i 's/https:\/\/076\.moe/http:\/\/076\.i2p/g' {} + https://076.moe,http://7dt6irsmfvbrtgn4nuah56kky6mvr472fbwwaltuxpf26qdqkdhfvnqd.onion"
cd .. i2pmap="https://ass.technicalsuwako.moe,http://ass.technicalsuwako.i2p
https://076.moe,http://076.i2p"
dir=("tor" "ttor" "i2p" "ti2p")
for d in "${dir[@]}"; do
if [[ $d == "tor" || $d == "ttor" ]]; then
kosin "$d" "$tormap"
else
kosin "$d" "$i2pmap"
fi
done
### 両方同期 ### 両方同期
rsync -rtvzP tor ${DARK}:/var/www/htdocs/technicalsuwako.moe for d in "${dir[@]}"; do
rsync -rtvzP i2p ${DARK}:/var/www/htdocs/technicalsuwako.moe rsync -rtvzP ${d} ${SRV}:/var/www/htdocs/technicalsuwako.moe
done
## ティルデ ## ティルデHTTP
cp -r www public_html cp -r www public_html
cd 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/href="\//href="\/\~technicalsuwako\//g' {} +
@ -69,3 +91,18 @@ find . -type f -name "*.html" -exec sed -i 's/src="\//src="\/\~technicalsuwako\/
find . -type f -name "*.css" -exec sed -i 's/static/\~technicalsuwako\/static/g' {} + find . -type f -name "*.css" -exec sed -i 's/static/\~technicalsuwako\/static/g' {} +
cd .. cd ..
rsync -rtvzP public_html ${TILDE}:/home/technicalsuwako rsync -rtvzP public_html ${TILDE}:/home/technicalsuwako
## ティルデGMI
rm -rf public_gemini
cp -r gemini public_gemini
rm -rf public_gemini/static
cd public_gemini
find . -type f -name "blog.atom" -exec sed -i 's/gemini:\/\/technicalsuwako\.moe/gemini:\/\/tilde\.club\/\~technicalsuwako/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/gemini:\/\/technicalsuwako\.moe/gemini:\/\/tilde\.club\/\~technicalsuwako/g' {} +
find . -type f -name "*.gmi" -exec sed -i 's/=> \//=> \/\~technicalsuwako\//g' {} +
cd ..
rsync -rtvzP public_gemini ${TILDE}:/home/technicalsuwako