styling and fixes

This commit is contained in:
nathan 2016-06-06 15:33:59 -04:00
parent ec2ec6eb5f
commit 7ee09605c2

View File

@ -1,22 +1,22 @@
# designed to be called from top level project dir
script_folder=$(dirname $0)
source config/asc.conf || exit 1
sqlplus $username/$password@$database_connection @$script_folder/generate_new_app_id.sql || exit 1
sqlplus ${username}/${password}@${database_connection} @${script_folder}/generate_new_app_id.sql || exit 1
app_id=$(cat config/new_app_id.txt)
app_id=$(head -n 1 config/new_app_id.txt)
if [ -h config/asc.conf ]; then
conf_file=$(readlink ./config/asc.conf)
echo "The id ${app_id} will be written to ${conf_file}. Is this alright? [y/N]: "
read read_bool
echo "The id '${app_id}' will be written to '${conf_file}'. Is this alright? [y/N]: "
read can_write
if [ $read_bool == "y" ]; then
if [ "${can_write}" == "y" ]; then
sed -i 's/^apexappid=.*/apexappid=${app_id}/' config/${conf_file}
echo "apexappid in ${conf_file} has been replaced with ${app_id}. The new config file looks like this: "
echo "apexappid in '${conf_file}' has been replaced with '${app_id}'. The new config file looks like this: "
cat config/${conf_file}
else
echo -n "The generated app id was not written to file. "
echo "You can change this manually by changing the apexappid of your config to ${app_id}"
echo "You can change this manually by changing the apexappid of your config to '${app_id}'"
fi
fi