manager: Update randomizer to avoid bug

Revert "manager: Update randomizer to avoid bug"

This reverts commit af9205e70a11db3e3d43bb34de880bbd6b4185b5.

manager: Update randomizer to avoid bug
This commit is contained in:
YC酱luyancib
2025-07-05 23:57:00 +08:00
committed by luyanci
parent e4663cfa68
commit 412375d104

View File

@@ -4,17 +4,24 @@
word1=$(tr -dc 'a-z' </dev/urandom | head -c6)
word2=$(tr -dc 'a-z' </dev/urandom | head -c6)
word3=$(tr -dc 'a-z' </dev/urandom | head -c6)
word4=$(tr -dc 'a-z' </dev/urandom | head -c6)
# Export variables for use in find -exec
export word1 word2 word3
export word1 word2 word3 word4
# Rename directories
find . -depth -type d -name 'com' -execdir mv {} "$word1" \;
find . -depth -type d -name 'sukisu' -execdir mv {} "$word2" \;
find . -depth -type d -name 'ultra' -execdir mv {} "$word3" \;
find . -depth -type d -name 'io' -execdir mv {} "$word4" \;
# Replace inside files
find . -type f -exec sed -i \
-e "s/com\.sukisu\.ultra/$word1.$word2.$word3/g" \
-e "s/io\.sukisu\.ultra/$word4.$word2.$word3/g" \
-e "s/com\/sukisu\/ultra/$word1\/$word2\/$word3/g" \
-e "s/io\/sukisu\/ultra/$word4\/$word2\/$word3/g" \
-e "s/io_sukisu_ultra/${word4}_${word2}_${word3}/g" \
-e "s/com_sukisu_ultra/${word1}_${word2}_${word3}/g" {} +