update install config script to allow installation to /etc

This commit is contained in:
Andre Puschmann 2018-12-11 20:50:36 +01:00
parent c88cc35fdf
commit 571963b53d
1 changed files with 26 additions and 2 deletions

View File

@ -3,8 +3,29 @@
# Auto-updated by CMake with actual install path
SRSLTE_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}"
# Default folder where configs go
dest_folder="$HOME/.srs"
# check if install mode has been provided
if ([ ! $1 ])
then
echo "Please call script with either user or service as first parameter."
echo ""
echo "E.g. ./srslte_install_configs.sh user"
echo " .. to install all config files to $HOME/.srs"
echo ""
echo "E.g. ./srslte_install_configs.sh service"
echo " .. to install all config files to /etc/srslte"
exit
fi
if [ "$1" == "user" ]
then
dest_folder="$HOME/.srs"
elif [ "$1" == "service" ]
then
dest_folder="/etc/srslte"
else
echo "Please call script with either user or service as first parameter."
exit
fi
install_file(){
source_path="$SRSLTE_INSTALL_DIR/$1"
@ -40,6 +61,9 @@ echo "Installing srsLTE configuration files:"
if [ ! -d "$dest_folder" ]; then
echo " - Creating srsLTE config folder $dest_folder"
mkdir $dest_folder
if [ $? -ne 0 ]; then
exit
fi
fi