Showing 2 changed files with 6 additions and 6 deletions
+5 -5
.fgfs/fgaddon
... ...
@@ -28,7 +28,7 @@ function trap_exit () {
28 28
     echo "updating installation status"
29 29
     for ac in $(sqlite_request 'select printf("%i:%s/%s", aircrafts.id, aircrafts.name, setxml.file) from aircrafts inner join setxml where aircrafts.id = setxml.variantof;'); do
30 30
         ac_path=${ac#*:}
31
-        test ! -e $fgaddon_path/$ac_path
31
+        test ! -e $fgaddon_path/$ac_path-set.xml
32 32
         installed=$?
33 33
         sqlite_request "update setxml set installed = $installed where file = '${ac_path#*/}' and variantof = ${ac%:*}"
34 34
     done
... ...
@@ -61,9 +61,9 @@ update_database () {
61 61
     id=$(sqlite_request "select id from aircrafts where name is '$ac'")
62 62
 
63 63
     wget -qO- $fgaddon_url/$ac > $aircraft
64
-    for sx in $(sed -rn 's/<a class="icon" href="(.+-set.xml)" title=".+"><i class="fa fa-file-o">.+$/\1/p' $aircraft); do
65
-        echo " -> ${sx/-set.xml}"
66
-        wget -qO- $fgaddon_url/$ac/$sx > $setxml
64
+    for sx in $(sed -rn 's/<a class="icon" href="(.+)-set.xml" title=".+"><i class="fa fa-file-o">.+$/\1/p' $aircraft); do
65
+        echo " -> $sx"
66
+        wget -qO- $fgaddon_url/$ac/$sx-set.xml > $setxml
67 67
         for attribute in ${attributes[@]}; do
68 68
             get_attribute $attribute
69 69
         done
... ...
@@ -83,7 +83,7 @@ update_database () {
83 83
                 fi
84 84
             done
85 85
         else
86
-            test ! -e $fgaddon_path/$ac/$sx
86
+            test ! -e $fgaddon_path/$ac/$sx-set.xml
87 87
             installed=$?
88 88
             sqlite_request "insert into setxml values ('$sx', $id, '$description', '$long_description', '$author', '$type', '$flight_model', $installed)"
89 89
         fi
+1 -1
.fgfs/fgfs_function
... ...
@@ -156,7 +156,7 @@ function fgfs () {
156 156
 ############ APPAREIL DANS FGADDON ?
157 157
             elif which sqlite3 > /dev/null 2>&1 \
158 158
             && test -r $FGADDON/fgaddon.db \
159
-            && test $(sqlite3 $FGADDON/fgaddon.db <<< "select count(file) from setxml where file is '${fgfs_arg}-set.xml'") -eq 1; then
159
+            && test $(sqlite3 $FGADDON/fgaddon.db <<< "select count(file) from setxml where file is '${fgfs_arg}'") -eq 1; then
160 160
                 model=$(sqlite3 $FGADDON/fgaddon.db <<< "select name from aircrafts inner join setxml on aircrafts.id = setxml.variantof where setxml.file is '${fgfs_arg}-set.xml'")
161 161
                 read -q "REPLY?download $model ? (y/N) "
162 162
                 read