# 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 app_id=$(head -c -1 config/new_app_id.txt | sed -e 's/[[:space:]]*$//') if [ -h config/asc.conf ]; then conf_file=$(readlink ./config/asc.conf) echo -n "The id '${app_id}' will be written to '${conf_file}'. Is this alright? [y/N]: " read can_write 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: " 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}'" fi fi rm -f config/new_app_id.txt