MT#4585 - added "--no-db-sync" option that skips sync-db/sync-constants

0.18
Kirill Solomko 12 years ago
parent 0a98fb93cb
commit ec2fa4eb1a

@ -97,6 +97,7 @@ export LC_ALL=C
# make sure it's available in all helper scripts
[ -n "${DEBUG:-}" ] && export DEBUG
[ -n "${NO_DB_SYNC:-}" ] && export NO_DB_SYNC
# export for access via build_config etc
export CONFIG_POOL

@ -131,7 +131,8 @@ case ${1:-} in
decrypt) shift ; decrypt "$*" ;;
diff) shift ; diff "$*" ;;
init-mgmt) shift ; init-mgmt "$*" ;;
--debug) export DEBUG=1 ; shift ; $0 $* ;;
--debug) export DEBUG=1 ; shift ; $0 $* ;;
--no-db-sync) export NO_DB_SYNC=1 ; shift ; $0 $* ;;
-h|--help|help) usage ; exit 0;;
-v|--version|version) version ; exit 0;;
*) usage 1; exit 1;;

@ -17,8 +17,11 @@ HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}"
cd "$NGCPCTL_MAIN"
"${HELPER}/sync-db" "$NGCPCTL_CONFIG" "$CONSTANTS_CONFIG" || true
if [ -z "${NO_DB_SYNC:-}" ] ; then
"${HELPER}/sync-db" "$NGCPCTL_CONFIG" "$CONSTANTS_CONFIG" || true
else
log_debug "no-db-sync: skipping 'sync-db'"
fi
if ! git config user.name >/dev/null ; then
log_debug 'git config user.name ngcp-config'
@ -58,7 +61,11 @@ fi
log_debug "/usr/share/ngcp-ngcpcfg/scripts/etckeeper"
/usr/share/ngcp-ngcpcfg/scripts/etckeeper >/dev/null
log_info "Synchronizing data from ${CONSTANTS_CONFIG}"
ngcp-sync-constants >/dev/null
if [ -z "${NO_DB_SYNC:-}" ] ; then
log_info "Synchronizing data from ${CONSTANTS_CONFIG}"
ngcp-sync-constants >/dev/null
else
log_debug "no-db-sync: skipping 'ngcp-sync-constants'"
fi
## END OF FILE #################################################################

Loading…
Cancel
Save