Hacking Sync-wbfs script

DynomiteGopher

Member
Newcomer
Joined
Jun 16, 2010
Messages
5
Reaction score
0
Trophies
0
XP
2
Country
Canada
Sync-WBFS v0.03.1, 10-07-01

Add files, archives and directories to a WBFS partition

Add Wii disc images to a wbfs formatted partition. Input can ge given as either a directory to be scanned for all supported files or as files.
Supported files are .ciso, .iso, .wbi and .wdf images and can be automatically extracted from 7zip, bzip2, gzip, rar, tar and zip and archives.

Dependencies

It uses Wiimm's awesome command line tool which you'll need.
WIT: Wiimms ISO Tools Thread

You'll also need p7zip, unrar-nonfree, and unzip if you don't have them already.

Quick guide on how to use this script

Change log v0.03.1, 10-07-01


Code:
.wbi support added

7zip archives with passwords skipped
Script would instead hang awaiting a password now they will be skipped
Change log v0.03, 10-06-26

--partition Option
You can now specify the location of your WBFS partition by giving it's blockdev path, add files to all detected WBFS partitions or have the
WBFS partition automatically chosen.

Special Character Support
File handling improved to allow for filenames with any special characters in them, including spaces, new lines, etc.

Archive and Image Type Checking
ISOs are now checked by wit to verify they are Wii disc images. ISOs can be either archived or loose.

Cleaner Verbose and Error Messages
Verbose messages have been improved to be easier to read and provide more overall progress information.
Error messages now provide more information especially wwt errors through 'wwt error'.

Duplicate File Skipping
Duplicate files can no longer be added and will now be skipped.

--directory and --file Options Removed
sync-wbfs will now automatically add any file or directories given as arguments

To Do List

RAR and 7ZIP password support.

GTK GUI using zenity to make it easier to use for the average user.

Download
 
nice
smile.gif


some bash tips for lists that supports words with blanks and special chars:
CODE# define an empty list
list=()

# define a noneÂÂempty list
list=(word-1 "word 2" "$word3"ÂÂ"${more_words[@]}")
# or
list=(
ÂÂ word-1
ÂÂ"word 2"
ÂÂ"$word3"ÂÂ
ÂÂ"${more_words[@]}"
)

# add an word that may include spaces into a list
list=("${list[@]}" "new word")

# use a list as parameter without in-word breaking
# importand: is list contains no words it expands to nothing and not to an empty parameter
wit --options "${list[@]}"

# concatenate the list into one word
word="${list[*]}"

# select each word in a loop
list=(a "b c " d)
for (( i=0; i
 
Thanks for the advice. I implemented arrays into the script and cleaned it up, the download link should be updated. Any more tips would be greatly appreciated.
 
I'm running Ubuntu 10, and call me stupid, but I have no idea how to install or run this script. Scripty things have always eluded me. Can someone give me a brief tutorial?
 
Right click on the file -- > properties.

Select the tab permissions ---> check allow executing file as a program

ubuntu-startconky-file-propterties-permissions-1.png


then double click in the file
 
unused_bagels said:
I'm running Ubuntu 10, and call me stupid, but I have no idea how to install or run this script. Scripty things have always eluded me. Can someone give me a brief tutorial?
I think all Linux users have been there at one point. Hopefully this helps you out.

First install all the dependencies you'll need with:

Code:
sudo apt-get install p7zip-full unrar-nonfree unzip

Next, you need to install Wiimms ISO Tools.

Download the newest version from his thread

Extract the downloaded archive.

You can install it globally by running install.sh as root.
Code:
sudo ."/path/to/install.sh"

Or locally by putting the contents of the archive's bin folder into "/home/yourusername/bin"

Install sync-wbfs

You'll need to set my script's permissions as executable you can do this using nautilus as shown above by Polada or using the following through the command line.
Code:
chmod 755 "/path/to/sync-wbfs"

You can then put my script into "/home/yourusername/bin" so that you can run it just by typing "sync-wbfs" in the terminal.

Finally run it!

Code:
sync-wbfs "/diretory/to/be/scanned/and/added" "/path/to/iso.iso" "/path/to/archive.rar" etc.

For more help on how to use it run
Code:
sync-wbfs --help

You may have to create a bin folder in your home directory and edit .bash_profile if you never have by adding the following line into it, otherwise the script may not be found in the terminal.
CODEmkdir ~/bin && echo 'export PATH=$PATH:~/bin' >> ~/.bash_profile

Hope that works, feel free to ask if you have any more troubles.
 
Arm the Homeless said:
Looks like pretty nice code.

And it even uses case statements. I usually yell at 99% of developers for not using them when they should.
I do aim to please, thanks for not yelling.

Wiimm said:
You have forgotten *.wbi (same as *.ciso, used by some managers)
Should now be supported, it was simple enough to add. Thanks for pointing that out.

Wiimm said:
I have found "cat
 

Site & Scene News

Popular threads in this forum