Skip to content

Instantly share code, notes, and snippets.

@jacquesbh
Created July 9, 2012 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacquesbh/3075019 to your computer and use it in GitHub Desktop.
Save jacquesbh/3075019 to your computer and use it in GitHub Desktop.
Jbh notice (Magento module) bash script (JolieBox)
toDev () {
if [[ $# < 2 ]]; then
echo "Usage: toDev <db name> <website name>";
return 1
fi
db=$1
shift
NAME=$@
req="
UPDATE core_config_data SET scope = 'default', scope_id = '0', path = 'dev/jbh_notice/admin_message', value = '$NAME - Development Admin Panel' WHERE path = 'dev/jbh_notice/admin_message';
UPDATE core_config_data SET scope = 'default', scope_id = '0', path = 'dev/jbh_notice/admin_bg_color', value = '#6289fe' WHERE path = 'dev/jbh_notice/admin_bg_color';
UPDATE core_config_data SET scope = 'default', scope_id = '0', path = 'dev/jbh_notice/frontend_active', value = '1' WHERE path = 'dev/jbh_notice/frontend_active';
UPDATE core_config_data SET scope = 'default', scope_id = '0', path = 'dev/jbh_notice/frontend_message', value = '$NAME - Development env.' WHERE path = 'dev/jbh_notice/frontend_message';
UPDATE core_config_data SET scope = 'default', scope_id = '0', path = 'dev/jbh_notice/frontend_bg_color', value = '#6289fe' WHERE path = 'dev/jbh_notice/frontend_bg_color';
-- Here the update for CDN - change it if you need !
UPDATE core_config_data SET value = REPLACE(value, 'static.joliebox.com', 'static.local.joliebox.com');
-- UPDATE core_config_data SET scope = ''
"
echo $req | mysql $db
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment