From: Chris Sharp Date: Thu, 1 Feb 2018 22:43:20 +0000 (-0500) Subject: rename pg_config since there's already a PG script named that X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=82738e37e73e5265e40c0097d3d2e826c5823e16;p=contrib%2Fpines.git rename pg_config since there's already a PG script named that --- diff --git a/pines-finder/auditor_actor_usr_history.sh b/pines-finder/auditor_actor_usr_history.sh index a2d4fd9..228601a 100755 --- a/pines-finder/auditor_actor_usr_history.sh +++ b/pines-finder/auditor_actor_usr_history.sh @@ -18,7 +18,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; # if we have no command line arguments, prompt the user diff --git a/pines-finder/auditor_asset_copy_history.sh b/pines-finder/auditor_asset_copy_history.sh index 827a40f..dc51aaf 100755 --- a/pines-finder/auditor_asset_copy_history.sh +++ b/pines-finder/auditor_asset_copy_history.sh @@ -19,7 +19,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; # if we have no command line arguments, prompt the user diff --git a/pines-finder/custom_perms_per_user.sh b/pines-finder/custom_perms_per_user.sh index db4e5fe..d0aaca4 100755 --- a/pines-finder/custom_perms_per_user.sh +++ b/pines-finder/custom_perms_per_user.sh @@ -18,7 +18,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; # if we have no command line arguments, prompt the user diff --git a/pines-finder/find_at_email_notifications.sh b/pines-finder/find_at_email_notifications.sh index b70e5b2..29354aa 100755 --- a/pines-finder/find_at_email_notifications.sh +++ b/pines-finder/find_at_email_notifications.sh @@ -15,7 +15,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ ! -z "$AT_EVENT_DEF" ]; then diff --git a/pines-finder/find_at_hold_notifications.sh b/pines-finder/find_at_hold_notifications.sh index 012bee4..f328c09 100755 --- a/pines-finder/find_at_hold_notifications.sh +++ b/pines-finder/find_at_hold_notifications.sh @@ -15,7 +15,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ ! -z "$BARCODE" ] && [ -z "$EMAIL" ]; then diff --git a/pines-finder/find_at_pmc_notifications.sh b/pines-finder/find_at_pmc_notifications.sh index 77871fc..936c5cb 100755 --- a/pines-finder/find_at_pmc_notifications.sh +++ b/pines-finder/find_at_pmc_notifications.sh @@ -15,7 +15,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ ! -z "$BARCODE" ] && [ -z "$EMAIL" ]; then diff --git a/pines-finder/find_at_sms_notifications.sh b/pines-finder/find_at_sms_notifications.sh index 85f04a5..67dcbb6 100755 --- a/pines-finder/find_at_sms_notifications.sh +++ b/pines-finder/find_at_sms_notifications.sh @@ -14,7 +14,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ ! -z "$AT_EVENT_DEF" ]; then diff --git a/pines-finder/generate_user_checkout_history.sh b/pines-finder/generate_user_checkout_history.sh index a072b3e..12d774d 100755 --- a/pines-finder/generate_user_checkout_history.sh +++ b/pines-finder/generate_user_checkout_history.sh @@ -18,7 +18,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ "$SERVER" = "test" ]; then diff --git a/pines-finder/get_active_library_count.sh b/pines-finder/get_active_library_count.sh index bb1d0ca..6a987bc 100755 --- a/pines-finder/get_active_library_count.sh +++ b/pines-finder/get_active_library_count.sh @@ -1,5 +1,5 @@ #!/bin/bash -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; psql -U evergreen -h $PG_HOST -c 'select count(*) from actor.org_unit where ou_type not in (1, 2) and opac_visible' diff --git a/pines-finder/get_active_library_list.sh b/pines-finder/get_active_library_list.sh index df69b64..415100d 100755 --- a/pines-finder/get_active_library_list.sh +++ b/pines-finder/get_active_library_list.sh @@ -1,5 +1,5 @@ #!/bin/bash -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; psql -U evergreen -h $PG_HOST -A -o pines_active_libraries_`date +%F`.csv -c 'select pou.name as "System", ou.name as "Branch/Bookmobile/Sub-Lib" from actor.org_unit ou join actor.org_unit pou on (ou.parent_ou = pou.id) where ou.ou_type not in (1, 2) and ou.opac_visible order by 1, 2' diff --git a/pines-finder/get_active_library_list_with_ids.sh b/pines-finder/get_active_library_list_with_ids.sh index 3c72dc4..aa23b99 100755 --- a/pines-finder/get_active_library_list_with_ids.sh +++ b/pines-finder/get_active_library_list_with_ids.sh @@ -1,5 +1,5 @@ #!/bin/bash -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; psql -U evergreen -h $PG_HOST -A -o pines_active_libraries_with_ids_`date +%F`.csv -c 'select pou.name as "System", ou.name as "Branch/Bookmobile/Sub-Lib", ou.id as "ID", ou.shortname as "PINES Code" from actor.org_unit ou join actor.org_unit pou on (ou.parent_ou = pou.id) where ou.ou_type not in (1, 2) and ou.opac_visible order by 1, 2' diff --git a/pines-finder/get_billing_history.sh b/pines-finder/get_billing_history.sh index be8a662..5c72a9c 100755 --- a/pines-finder/get_billing_history.sh +++ b/pines-finder/get_billing_history.sh @@ -20,7 +20,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; # if we have no command line arguments, or both billings and payments selected, exit the script diff --git a/pines-finder/get_circ_history.sh b/pines-finder/get_circ_history.sh index 5a9bbb1..d8a75ed 100755 --- a/pines-finder/get_circ_history.sh +++ b/pines-finder/get_circ_history.sh @@ -20,7 +20,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ "$SERVER" = "test" ]; then diff --git a/pines-finder/get_combined_perms_per_profile.sh b/pines-finder/get_combined_perms_per_profile.sh index 87d9936..39e9d81 100755 --- a/pines-finder/get_combined_perms_per_profile.sh +++ b/pines-finder/get_combined_perms_per_profile.sh @@ -6,7 +6,7 @@ exit 1 } GROUP_NAME="$1" -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; diff --git a/pines-finder/get_email_logs.sh b/pines-finder/get_email_logs.sh index ea0e8b6..5671af1 100755 --- a/pines-finder/get_email_logs.sh +++ b/pines-finder/get_email_logs.sh @@ -28,7 +28,7 @@ if [ -z "$USER_BARCODE" ] || [ -z "$DUE_DATE" ]; then Usage; fi -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; NOTICE_DATE=$(date -d "$DUE_DATE -3 days" +%F) diff --git a/pines-finder/get_hold_history.sh b/pines-finder/get_hold_history.sh index ad0b873..bdc9671 100755 --- a/pines-finder/get_hold_history.sh +++ b/pines-finder/get_hold_history.sh @@ -20,7 +20,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ "$SERVER" = "test" ]; then diff --git a/pines-finder/get_reports_template_ids.sh b/pines-finder/get_reports_template_ids.sh index 8fb8008..b85db48 100755 --- a/pines-finder/get_reports_template_ids.sh +++ b/pines-finder/get_reports_template_ids.sh @@ -17,7 +17,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ -z "$USER_BARCODE" ]; then diff --git a/pines-finder/get_transit_history.sh b/pines-finder/get_transit_history.sh index 53610b4..2d95953 100755 --- a/pines-finder/get_transit_history.sh +++ b/pines-finder/get_transit_history.sh @@ -19,7 +19,7 @@ do case "$OPTIONS" in esac done -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; if [ "$SERVER" = "test" ]; then diff --git a/pines-finder/pg_config b/pines-finder/pg_config deleted file mode 100644 index bfa46f1..0000000 --- a/pines-finder/pg_config +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# configuration for DB - read by all pines-finder files, -# so make sure this file is in the same working directory -# as each script. - -# Note: it is assumed that you're using .pgpass here -PSQL="/usr/bin/psql" -PSQL_USER="mydbuser" -PSQL_HOST="mydbhost" -PSQL_DB="mydbname" diff --git a/pines-finder/pg_db_config b/pines-finder/pg_db_config new file mode 100644 index 0000000..bfa46f1 --- /dev/null +++ b/pines-finder/pg_db_config @@ -0,0 +1,11 @@ +#!/bin/bash + +# configuration for DB - read by all pines-finder files, +# so make sure this file is in the same working directory +# as each script. + +# Note: it is assumed that you're using .pgpass here +PSQL="/usr/bin/psql" +PSQL_USER="mydbuser" +PSQL_HOST="mydbhost" +PSQL_DB="mydbname" diff --git a/pines-finder/predue_lookup.sh b/pines-finder/predue_lookup.sh index 4f15fcd..35e46f5 100755 --- a/pines-finder/predue_lookup.sh +++ b/pines-finder/predue_lookup.sh @@ -31,7 +31,7 @@ if [ -z "$USER_BARCODE" ] || [ -z "$DUE_DATE" ]; then Usage; fi -PG_CONFIG="pg_config" +PG_CONFIG="pg_db_config" source $PG_CONFIG || echo "PostgreSQL configuration file $PG_CONFIG not found. exiting" && exit 1; NOTICE_DATE=$(date -d "$DUE_DATE -2 days" +%F)