28
29
use vars qw(%opts);
31
print "gnupod_addsong.pl Version 0.94rc1 (C) 2002-2004 Adrian Ulrich\n";
32
print "gnupod_INIT.pl ###__VERSION__### (C) Adrian Ulrich\n";
33
34
$opts{mount} = $ENV{IPOD_MOUNTPOINT};
34
35
#Don't add xml and itunes opts.. we *NEED* the mount opt to be set..
35
GetOptions(\%opts, "help|h", "mount|m=s", "disable-convert|d", "france|f");
36
GetOptions(\%opts, "version", "help|h", "mount|m=s", "disable-convert|d", "france|f");
37
#gnupod_INIT does not read configuration files!
37
39
usage() if $opts{help};
40
version() if $opts{version};
48
51
## Ask the user, if he still knows what he/she's doing..
51
Your iPod it mounted at $opts{mount}, ok ?
54
Your iPod is mounted at $opts{mount}, ok ?
52
55
*********************************************************
53
56
This tool creates the default directory tree on your iPod
54
57
and creates an *empty* GNUtunesDB (..or convert your old
55
58
iTunesDB to a new GNUtunesDB).
57
60
You only have to use this command if
58
a) You never used GNUpod with this iPod
59
b) You did an 'rm -rf' on your iPod
61
-> You never used GNUpod with this iPod
62
or -> You did an 'rm -rf' on your iPod
61
64
btw: use 'gnupod_addsong -m $opts{mount} --restore'
62
65
if you lost your songs on the iPod after using
94
print "> Creating 'Limit' file (because you used --france)\n";
95
mkdir("$opts{mount}/iPod_Control/Device");
96
open(LIMIT, ">$opts{mount}/iPod_Control/Device/Limit") or die "Failed: $!\n";
97
print LIMIT "216\n"; #Why?
100
elsif(-e "$opts{mount}/iPod_Control/Device/Limit") {
101
print "> Removing 'Limit' file (because you didn't use --france)\n";
102
unlink("$opts{mount}/iPod_Control/Device/Limit");
105
print "> No 'Limit' file created or deleted..\n";
97
print "> Creating 'Limit' file (because you used --france)\n";
98
mkdir("$opts{mount}/iPod_Control/Device");
99
open(LIMIT, ">$opts{mount}/iPod_Control/Device/Limit") or die "Failed: $!\n";
100
print LIMIT "216\n"; #Why?
103
elsif(-e "$opts{mount}/iPod_Control/Device/Limit") {
104
print "> Removing 'Limit' file (because you didn't use --france)\n";
105
unlink("$opts{mount}/iPod_Control/Device/Limit");
108
print "> No 'Limit' file created or deleted..\n";
108
111
print "> Creating dummy files\n";
110
GNUpod::XMLhelper::writexml($con->{xml});
113
GNUpod::XMLhelper::writexml($con);
113
116
if(-e $con->{itunesdb} && !$opts{'disable-convert'}) {
135
138
Usage: gnupod_INIT.pl [-h] [-m directory]
138
-m, --mount=directory : iPod mountpoint, default is \$IPOD_MOUNTPOINT
139
-d, --disable-convert : Don't try to convert an exiting iTunesDB
140
-f, --france : Limit volume to 100dB (For French-People)
141
Maximal-volume without this is ~104dB (VERY LOUD)
142
*WARNING* This works only for iPods running
143
Firmware 1.x (1st & 2nd generation)
144
You can also use mktunes.pl '--volume PERCENT'
145
to adjust the volume (Works with Firmware 1.x AND 2.x)
140
-h, --help display this help and exit
141
--version output version information and exit
142
-m, --mount=directory iPod mountpoint, default is \$IPOD_MOUNTPOINT
143
-d, --disable-convert Don't try to convert an existing iTunesDB
144
-f, --france Limit volume to 100dB (For French-Law/People)
145
Maximal-volume without this is ~104dB (VERY LOUD)
146
*WARNING* This works only for iPods running
147
Firmware 1.x (1st & 2nd generation)
148
You can also use mktunes.pl '--volume PERCENT'
149
to adjust the volume (Works with Firmware 1.x AND 2.x)
151
Report bugs to <bug-gnupod\@nongnu.org>
157
gnupod_INIT.pl (gnupod) ###__VERSION__###
158
Copyright (C) Adrian Ulrich 2002-2004
160
This is free software; see the source for copying conditions. There is NO
161
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.