Commit 1869062e by Bach Dániel

context: redhat support added

parent 9dbe3757
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
echo "En vagyok a $0 !" echo "En vagyok a $0 !"
hostname "$HOSTNAME" hostname "$HOSTNAME"
echo "$HOSTNAME" > /etc/hostname
if [ "$DISTRO" == "ubuntu" ]; then
echo "$HOSTNAME" > /etc/hostname
fi
if [ "$DISTRO" == "redhat" ]; then
echo -e -n "NETWORKING=yes\nHOSTNAME=$HOSTNAME\n" > /etc/sysconfig/network
fi
sed "s/\(127\.0\.1\.1\).*/\1\t$HOSTNAME/" -i /etc/hosts sed "s/\(127\.0\.1\.1\).*/\1\t$HOSTNAME/" -i /etc/hosts
...@@ -13,6 +13,7 @@ echo ok "$ipv4 $ipv6 $gw4 $gw6" ...@@ -13,6 +13,7 @@ echo ok "$ipv4 $ipv6 $gw4 $gw6"
/etc/init.d/network-manager stop /etc/init.d/network-manager stop
ifdown eth0 || ifconfig eth0 0 down ifdown eth0 || ifconfig eth0 0 down
if [ "$DISTRO" == "ubuntu" ]; then
cat > /etc/network/interfaces << EOF cat > /etc/network/interfaces << EOF
auto lo auto lo
iface lo inet loopback iface lo inet loopback
...@@ -30,4 +31,28 @@ EOF ...@@ -30,4 +31,28 @@ EOF
ifup eth0 ifup eth0
fi
if [ "$DISTRO" == "redhat" ]; then
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
DEVICE="eth0"
BOOTPROTO="none"
IPV6INIT="yes"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
DNS1="152.66.243.60"
PEERDNS="yes"
IPADDR="$ipv4"
NETMASK="255.255.0.0"
GATEWAY=$gw4
IPV6ADDR="$ipv6/80"
IPV6_DEFAULTGW="$gw6"
EOF
ifup eth0
fi
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
echo "En vagyok a $0 !" echo "En vagyok a $0 !"
( while ! wget -T 2 -t 1 -q -O /dev/null "$BOOTURL" ; do sleep 5; done ) & ( while ! wget -T 2 -t 1 -q --no-check-certificate -O /dev/null "$BOOTURL" ; do sleep 5; done ) &
disown $! disown $!
...@@ -4,6 +4,15 @@ export BASEDIR=$(dirname $0) ...@@ -4,6 +4,15 @@ export BASEDIR=$(dirname $0)
export USER="cloud" export USER="cloud"
export HOME=$(awk -F: -v u=$USER '$1==u{print $6}' /etc/passwd) export HOME=$(awk -F: -v u=$USER '$1==u{print $6}' /etc/passwd)
if [ -f /etc/lsb-release ]; then
export DISTRO=ubuntu
fi
if [ -f /etc/redhat-release ]; then
export DISTRO=redhat
fi
echo $DISTRO
mkdir -p "$BASEDIR/mnt" mkdir -p "$BASEDIR/mnt"
cd "$BASEDIR" cd "$BASEDIR"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment