This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tsg-tsg-os-buildimage/ansible/roles/system-init-9140/templates/setup.eth_pf_mgmt1.ips.toml.j2
songyanchao f301aaba04 feat(TSG-9140): 添加mgmt1网卡自动配置IP功能
添加eth_pf_mgmt1自动配置10.253.x.x网段IP的脚本,可以通过3200单独连接
2021-07-30 03:44:55 -04:00

18 lines
387 B
Django/Jinja

#!/bin/bash
INF="$1"
STA="$2"
logger "$0 called for interface named $INF with $STA ..."
if [ "$INF" == "eth_pf_mgmt1" ]
then
logger "$0: Interface $INF with $STA ,Set $INF ipaddr ..."
output=$(ipmitool picmg addrinfo)
echo $output
substr=${output:22:1}
echo $substr
num=$((16#${substr}+16))
ipaddr='10.253.'$num'.1'
ifconfig eth_pf_mgmt1 $ipaddr netmask 255.255.0.0
fi