#!/bin/bash
#
# This script automates the configuration of the podgen package environment.
# It is intended to be executed after installing the package on a new machine.
#
# Modify the follwoing evn variables
# the podgen package path, default is the current
pkghome=`pwd`

# the system or your local python path
python_path=/data/jcsda3/mchen/local/miniforge3

# RNXCMP utility path
rnxcmp_path=/data/data504/BSW54/tools/RNXCMP_4.1.0

# the home path for podgen I/O with your read & write permission
data_home=/data/data504/POD_DATA


# Do not change the following lines
scripts=(rt_batch.bash rt_batch_reproc.bash rt_check.bash rt_check_missing.bash rt_cosmic2_bern.bash rt_wget_gnss_ultra.bash)
for f in ${scripts[@]}; do
  sed -Ei "s|(pkghome=).*|\1$pkghome|g" ${f}
done

sed -Ei "s|(pkghome=).*|\1$pkghome|g" set_env.bash


sed -Ei "s|(python_path=).*|\1${python_path}|g" set_env.bash
sed -Ei "s|(rnxcmp_path=).*|\1${rnxcmp_path}|g" set_env.bash
sed -Ei "s|(data_home=).*|\1${data_home}|g" set_env.bash
