ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/util/convvar
Revision: 1.2
Committed: Tue Jan 2 11:13:16 2007 UTC (17 years, 5 months ago) by root
Branch: MAIN
CVS Tags: rel-2_2, rel-2_0, rel-2_1, HEAD
Changes since 1.1: +3 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/bin/bash
2
3 # used to convert /var/crossfire from pre-2007 server versions to the 2007 version
4
5 export PERL_UNICODE=IOEioA
6
7 cd /var/crossfire || exit 55
8
9 rm tmp/*
10
11 (
12 cd unique-items || exit 77
13
14 echo -n "uq:"
15 for map in *.v00; do
16 if [ -e $map ]; then
17 #echo -n " $map"
18 dst=$(perl -Mutf8 -e 'for ($ARGV[0]) { s/\@/∕/g; s/\.v00$//; print }' "$map")
19 mv $map ∕$dst
20 [ -e $map.pst ] && mv $map.pst ∕$dst.pst
21 fi
22 done
23 echo
24 )
25
26 (
27 cd players || exit 66
28
29 echo -n "maps:"
30 for map in \
31 ∕nimbus \
32 ∕azumauindo∕minatomachi∕ketsueki_itsuryuu∕bigchest \
33 ∕azumauindo∕ranbounagisatoshi∕apartments∕sapartment \
34 ∕azumauindo∕suno-yamatoshi∕apartments∕lapartment1 \
35 ∕azumauindo∕suno-yamatoshi∕nenshou_youso∕bigchest \
36 ∕azumauindo∕zaseki∕dzuki_ryoku∕bigchest \
37 ∕brest∕apartments∕brest_town_house \
38 ∕brest∕black_shield∕bigchest \
39 ∕city∕apartment∕apartments \
40 ∕darcap∕darcap∕apartment \
41 ∕darcap∕darcap∕guilds∕poisoned_dagger∕bigchest \
42 ∕darcap∕darcap∕guilds∕smoking_cauldron∕bigchest \
43 ∕mlab∕cdcapart1 \
44 ∕mlab∕citydecloudsvillab1 \
45 ∕mlab∕citydecloudsvillab2 \
46 ∕mlab∕mlabhellcityofdisad \
47 ∕mlab∕mlabhellcityofdispermapart \
48 ∕mlab∕mountpermapartment \
49 ∕mlab∕mountpermapartment2 \
50 ∕mlab∕prisondemadnessHLi12bigchest1 \
51 ∕navar∕city∕apartments∕apartment \
52 ∕navar∕city∕apartments∕apartment∕attic \
53 ∕navar∕city∕apartments∕apartment∕basement \
54 ∕navar∕city∕apartments∕apartment∕upstairs \
55 ∕navar∕city∕dreaming_sage∕bigchest \
56 ∕onefang∕suites \
57 ∕pup_land∕guilds∕laughing_skull∕bigchest \
58 ∕pup_land∕guilds∕purple_butterfly∕bigchest \
59 ∕pup_land∕lone∕town∕apartment∕basement \
60 ∕pup_land∕lone∕town∕apartment∕groundfloor \
61 ∕pup_land∕lone∕town∕apartment∕upper1 \
62 ∕pup_land∕nurnberg∕apartment∕cave \
63 ∕pup_land∕nurnberg∕apartment∕main \
64 ∕pup_land∕nurnberg∕apartment∕upstairs \
65 ∕santo∕dominion∕guilds∕drunken_barbarian∕bigchest \
66 ∕santo∕dominion∕sdomino_appartment \
67 ∕scorn∕apartment∕Apartments1 \
68 ∕scorn∕apartment∕Apartments2 \
69 ∕scorn∕apartment∕Apartments3 \
70 ∕scorn∕apartment∕Apartments4 \
71 ∕scorn∕apartment∕Apartments5 \
72 ∕scorn∕apartment∕apartments \
73 ∕scorn∕guilds∕mailed_fist∕bigchest
74 do
75 underscore=$(perl -Mutf8 -e '$ARGV[0] =~ s/∕/_/g; print $ARGV[0]' $map)
76 #echo -n " $map"
77 for dir in */; do
78 if [ -e $dir$underscore ]; then
79 mv $dir$underscore $dir$map
80 fi
81 if [ -e $dir$underscore.pst ]; then
82 mv $dir$underscore.pst $dir$map.pst
83 fi
84 done
85 done
86 echo
87
88 echo -n "pl:"
89 for pl in */*.pl; do
90 #echo -n " $pl"
91 perl -Mutf8 -i -pe 's{^(savebed_map|map) (/var/crossfire/players/)}{$1 ~}g' $pl
92 done
93 echo
94 )
95
96