#!/bin/bash help(){ echo "eg: $0 [old-string] [new-string]" echo "" exit 1 } if [ ! -n "$1" ] ; then help fi if [ ! -n "$2" ] ; then help fi old_string=$1 new_string=$2 c_home=$(cd `dirname $0`; pwd) config_js=${c_home}/ui/config.js echo "Config js ${config_js}..." sed -i "s/ENABLE_CONFIG:false/ENABLE_CONFIG:true/g" ${config_js} sed -i "s/${old_string}/${new_string}/g" ${config_js}