2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-23 03:30:33 +00:00

Porting the `httpport' support patch from post.xcat to post.xcat.ng

This commit is contained in:
GONG Jie
2018-12-05 17:46:47 +08:00
parent 337fb4fa07
commit c6c5a5a346

View File

@@ -8,6 +8,7 @@ export XCATIPORT="#TABLE:site:key=xcatiport:value#"
export INSTALLDIR="#TABLE:site:key=installdir:value#"
export TFTPDIR="#TABLE:site:key=tftpdir:value#"
export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#"
export HTTPPORT="#TABLE:site:key=httpport:value#"
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/scriptlib#
@@ -31,6 +32,9 @@ fi
if [[ "${TFTPDIR:0:1}" != "/" ]]; then
TFTPDIR="/$TFTPDIR"
fi
if [ -z "$HTTPPORT" ]; then
HTTPPORT="80"
fi
NODESTATUS="$(echo "$NODESTATUS"| tr -d \'\" | tr A-Z a-z)"
@@ -82,6 +86,13 @@ else
echo "INSTALLDIR=$INSTALLDIR" >>/opt/xcat/xcatinfo
fi
grep 'HTTPPORT' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ $? -eq 0 ]; then
sed -i "s/HTTPPORT=.*/HTTPPORT=$HTTPPORT/" /opt/xcat/xcatinfo
else
echo "HTTPPORT=$HTTPPORT" >> /opt/xcat/xcatinfo
fi
case "$XCATDEBUGMODE" in
"1"|"2")
msgutil_r "$MASTER_IP" "debug" "/opt/xcat/xcatinfo generated" "/var/log/xcat/xcat.log" "$log_label"
@@ -127,7 +138,7 @@ function download_recursive()
return 0
}
download_recursive "http://$MASTER_IP$INSTALLDIR/postscripts/" "/xcatpost" 2>/tmp/download.log
download_recursive "http://$MASTER_IP:${HTTPPORT}$INSTALLDIR/postscripts/" "/xcatpost" 2>/tmp/download.log
if [ "$?" -ne "0" ]
then
msgutil_r "$MASTER_IP" "error" "failed to download postscripts from http://$MASTER_IP$INSTALLDIR/postscripts/, check /tmp/download.log on the node, halt ..." "/var/log/xcat/xcat.log" "$log_label"
@@ -143,7 +154,7 @@ export NODE="#TABLE:nodelist:THISNODE:node#"
msgutil_r "$MASTER_IP" "info" "trying to get mypostscript from $MASTER_IP..." "/var/log/xcat/xcat.log" "$log_label"
curl --fail --retry 20 --max-time 60 "http://$MASTER_IP$TFTPDIR/mypostscripts/mypostscript.$NODE" -o "/xcatpost/mypostscript.$NODE" 2> /tmp/download.log
curl --fail --retry 20 --max-time 60 "http://$MASTER_IP:${HTTPPORT}$TFTPDIR/mypostscripts/mypostscript.$NODE" -o "/xcatpost/mypostscript.$NODE" 2> /tmp/download.log
if [ "$?" = "0" ]
then
case "$XCATDEBUGMODE" in