Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ZeldaASTscript.hmod
- # Edit the sub folder structure to share the same saves between both 4 weeks roms
- # Games name must be as *Zelda*AST#* with # The week number
- # Example :
- # The_Legend_of_Zelda_-_AST1_(FR).sfrom
- # The_Legend_of_Zelda_-_AST2_(FR).sfrom
- # The_Legend_of_Zelda_-_AST3_(FR).sfrom
- # The_Legend_of_Zelda_-_AST4_(FR).sfrom
- # v0.1 - February 8th, 2018
- # Based on explanations https://imgur.com/a/mqJMC
- # Hakchi Module by Nark
- #Initialization
- #Zhome=/usr/share/games # uncomment for real use
- Zhome=/var/lib/hakchi/rootfs/usr/share/games
- # Retrieve folders
- ZFolder1=$(find $Zhome -name *Zelda*AST1*) #The full path of game1
- ZFolder2=$(find $Zhome -name *Zelda*AST2*)
- ZFolder3=$(find $Zhome -name *Zelda*AST3*)
- ZFolder4=$(find $Zhome -name *Zelda*AST4*)
- # Test if structure already modified
- if [ "$ZFolder2" != "" ]; then #if not, apply the modifications
- # Retrieve games file name
- Zfilename1="${ZFolder1##*/}" #The full name of game1
- Zfilename2="${ZFolder2##*/}"
- Zfilename3="${ZFolder3##*/}"
- Zfilename4="${ZFolder4##*/}"
- # Retrieve games file path
- ZPath1=$(dirname $ZFolder1) #The path of game1 file
- ZPath2=$(dirname $ZFolder2)
- ZPath3=$(dirname $ZFolder3)
- ZPath4=$(dirname $ZFolder4)
- # Retrieve Clover ID folder names
- ZGood1="${ZPath1##*/}" #The good folder name of game1
- ZBad2="${ZPath2%CLV*}" #The path of game2 folder without bad Clover ID folder
- ZBad3="${ZPath3%CLV*}" #The path of game3 folder without bad Clover ID folder
- ZBad4="${ZPath4%CLV*}" #The path of game4 folder without bad Clover ID folder
- #Perform modifications
- # Rename .sfrom from 2 3 and 4 to 1
- mv "$ZFolder2" "$ZPath2/$Zfilename1"
- mv "$ZFolder3" "$ZPath3/$Zfilename1"
- mv "$ZFolder4" "$ZPath4/$Zfilename1"
- # Old .png and .dektop delete from 2 3 and 4
- find $ZPath2 -name "*.png" -type f -delete
- find $ZPath2 -name "*.desktop" -type f -delete
- find $ZPath3 -name "*.png" -type f -delete
- find $ZPath3 -name "*.desktop" -type f -delete
- find $ZPath4 -name "*.png" -type f -delete
- find $ZPath4 -name "*.desktop" -type f -delete
- # Copy of .png and .dektop from 1 to 2 3 and 4
- cp -f $ZPath1/$ZGood1.png $ZPath2
- cp -f $ZPath1/$ZGood1\_small.png $ZPath2
- cp -f $ZPath1/$ZGood1.desktop $ZPath2
- cp -f $ZPath1/$ZGood1.png $ZPath3
- cp -f $ZPath1/$ZGood1\_small.png $ZPath3
- cp -f $ZPath1/$ZGood1.desktop $ZPath3
- cp -f $ZPath1/$ZGood1.png $ZPath4
- cp -f $ZPath1/$ZGood1\_small.png $ZPath4
- cp -f $ZPath1/$ZGood1.desktop $ZPath4
- # Rename folders from 2 3 and 4 to 1
- mv "$ZPath2" "$ZBad2$ZGood1"
- mv "$ZPath3" "$ZBad3$ZGood1"
- mv "$ZPath4" "$ZBad4$ZGood1"
- #echo === === Zelda \"Ancient Stone Tablets\" Mod applied === ===
- fi
- #Variables deallocation
- unset ZFolder1 ZFolder2 ZFolder3 ZFolder4
- unset Zfilename1 Zfilename2 Zfilename3 Zfilename4
- unset ZPath1 ZPath2 ZPath3 ZPath4
- unset Zhome ZGood1 ZBad2 ZBad3 ZBad4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement