Change-Id: Ia86dce4fb73893a63ab35003eef8341cbfb0cd4b Former-commit-id:dc50adc50c
[formerlyc09b38e5b5
] [formerly72728121e4
] [formerlydc50adc50c
[formerlyc09b38e5b5
] [formerly72728121e4
] [formerlyaf8fbacf72
[formerly72728121e4
[formerly 7855257369af383399d6cc2ea94d743e139263d2]]]] Former-commit-id:af8fbacf72
Former-commit-id:68c1c842e3
[formerly2a602a76f3
] [formerly 4000178559eedc79d31c13f7792e66a0f2a44580 [formerlyf289473792
]] Former-commit-id: 4479c6f2e926bf9e986904a654599a508d35eb04 [formerly4d18d761c9
] Former-commit-id:a132ecda55
36 lines
No EOL
1 KiB
Bash
36 lines
No EOL
1 KiB
Bash
#!/bin/bash
|
|
# DR #2316,2317 replace airep and pirep with ncairep and ncpirep
|
|
|
|
PSQL="/awips2/psql/bin/psql"
|
|
|
|
SQL_COMMAND="
|
|
delete from plugin_info where name in ('ncpirep','ncairep');
|
|
drop table pirep, pirep_anc_data, ncpirep_anc_data, airep;
|
|
alter table ncpirep rename to pirep;
|
|
alter table ncairep rename to airep;
|
|
update pirep set datauri = replace(datauri, 'ncpirep', 'pirep');
|
|
update airep set datauri = replace(datauri, 'ncairep', 'airep');
|
|
"
|
|
${PSQL} -U awips -d metadata -c "${SQL_COMMAND}"
|
|
|
|
if [ -d "/awips2/edex/data/hdf5/ncpirep" ]
|
|
then
|
|
mv /awips2/edex/data/hdf5/ncpirep /awips2/edex/data/hdf5/pirep
|
|
|
|
files=`ls /awips2/edex/data/hdf5/pirep/ncpirep*.h5`
|
|
for file in $files; do
|
|
newfile=${file/ncpirep/pirep}
|
|
mv $file $newfile
|
|
done
|
|
fi
|
|
|
|
if [ -d "/awips2/edex/data/hdf5/ncairep" ]
|
|
then
|
|
mv /awips2/edex/data/hdf5/ncairep /awips2/edex/data/hdf5/airep
|
|
|
|
files=`ls /awips2/edex/data/hdf5/airep/ncairep*.h5`
|
|
for file in $files; do
|
|
newfile=${file/ncairep/airep}
|
|
mv $file $newfile
|
|
done
|
|
fi |