X-Plane improve Navdata updates

master
Michael Raitza 2022-10-09 14:02:30 +02:00
parent ce83b956fa
commit aee0a14966
1 changed files with 6 additions and 2 deletions

View File

@ -141,6 +141,8 @@ let
elif [ -e "$XPLANEPATH/Custom Data/cycle_info.txt" ]; then
oldcycle=$(head -n1 "$XPLANEPATH/Custom Data/cycle_info.txt" | sed -E -n -e "s/^AIRAC cycle[ :]+([0-9]+)\r$/\1/p")
[ -n "$oldcycle" ] || { printf "Unable to determine old AIRAC cycle\n" >&2; exit 1; }
else
oldcycle=
fi
f=$1
[ -e "$f" ] || { printf "No such file or directory\n" >&2; exit 1; }
@ -148,7 +150,9 @@ let
cycle=''${cycle%.zip}
newpath="$XPLANEPATH/Custom Data AIRAC$cycle"
if [ ! -h "$XPLANEPATH/Custom Data" ]; then
if [ -z "$oldcycle" ]; then
rm -r "$XPLANEPATH/Custom Data"
elif [ ! -h "$XPLANEPATH/Custom Data" ]; then
mv "$XPLANEPATH/Custom Data" "$XPLANEPATH/Custom Data AIRAC$oldcycle"
fi
@ -173,7 +177,7 @@ let
Also, you can place the FAACIFP18 file here, which you can get from the FAA website: https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/cifp/
If the file FAACIFP18 is found in this folder, X-Plane will load instrument flight procedures from this file.
EOF
rm "$XPLANEPATH/Custom Data"
rm -f "$XPLANEPATH/Custom Data"
ln -sf "$newpath" "$XPLANEPATH/Custom Data"
'';