Skip to content

Commit

Permalink
update init_hostname.sh fix coremail path
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfeng committed Jan 2, 2013
1 parent 1f93ff9 commit 8e304d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmbin/install_milti_cm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ remote_change(){
${REMOTE_CTRL}${ci} "sed -i '[email protected]@${CMMDIP}@g' ${COREMAIL_HOME}/bin/mysql_cm" &>/dev/null
${REMOTE_CTRL}${ci} "chown -R coremail:coremail ${COREMAIL_HOME}" &>/dev/null
echo "This is ${ci} Mail Server"
${REMOTE_CTRL}${ci} "${COREMAIL_HOME}/sbin/cmctrl.sh start"
${REMOTE_CTRL}${ci} "sh ${CTOOLS}/cmbin/boot_coremail.sh" &>/dev/null
${REMOTE_CTRL}${ci} "sh ${CTOOLS}/sbin/init_hosts.sh" &>/dev/null
${REMOTE_CTRL}${ci} "sh ${CTOOLS}/sbin/init_hostname.sh" &>/dev/null
${REMOTE_CTRL}${ci} "sh ${CTOOLS}/cmbin/add_cmhosts.sh" &>/dev/null
${REMOTE_CTRL}${ci} "${COREMAIL_HOME}/sbin/cmctrl.sh start"
${REMOTE_CTRL}${ci} "sed -i '/${RSAPUB:1:50}/d' ~/.ssh/authorized_keys" &>/dev/null
done
}
Expand Down
2 changes: 1 addition & 1 deletion sbin/init_hostname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CTOOLS=/home/ctools
ETC_NETWORK=/etc/sysconfig/network
OLD_HOSTNAME=`grep "^HOSTNAME=" ${ETC_NETWORK}`
LOCAL_IP=`/sbin/ifconfig -a | awk '/inet/{print $2}' | awk -F: '{print $2}' | egrep -v "127.0.0.1|^$"`
CM_HOSTNAME=`grep -B1 "${LOCAL_IP}" ${COREMAIL_HOME}/conf/hosts.cf | xargs -n2 | sed 's/IP=//;s/\[//;s/\]//' | awk '{print $1}'`
CM_HOSTNAME=`grep -B1 "${LOCAL_IP}" /home/coremail/conf/hosts.cf | xargs -n2 | sed 's/IP=//;s/\[//;s/\]//' | awk '{print $1}'`
#CM_HOSTNAME=`grep -B1 "${LOCAL_IP}" ${CTOOLS}/cmconf/hosts.cf | xargs -n2 | sed 's/IP=//;s/\[//;s/\]//' | awk '{print $1}'`

[[ "${OLD_HOSTNAME}" == "HOSTNAME=mailsvr" ]] && exit
Expand Down

0 comments on commit 8e304d9

Please sign in to comment.