Even escaping the $ETH did not work. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Michael Mraka Sent: Wednesday, February 09, 2011 9:38 AM To: [email protected] Subject: Re: [Spacewalk-list] Variables not passing to snippets
Hagberg, Keith wrote: % What determines when you need raw mode. Basically *all* $ signs have to be escaped otherwise python-cheetah (the templating machine used by cobbler) gets mad and won't render the snippet. % If I remove #raw and #end raw the snippet does not get put into the % kickstart. When the kickstart is created it still has the snippet % name in it. % % I tried to escape the $ETH variable and it still will not replace it. % % Here is my snippet % % #raw % SPEED=`ethtool $ETH | grep Speed | cut -d' ' -f2` % if [ "$SPEED" == "1000Mb/s" ]; then % echo NIC running at 1000mb/s % echo "ETHTOOL_OPTS=\"speed 1000 duplex full autoneg on\"" >> /etc/sysconfig/network-scripts/ifcfg-$ETH % echo "Resetting "$ETH % ifup $DEV % elif [ "$SPEED" == "100Mb/s" ]; then % echo NIC running at 100mb/s % echo "ETHTOOL_OPTS=\"speed 100 duplex full autoneg off\"" >> /etc/sysconfig/network-scripts/ifcfg-"$ETH" % echo "Resetting "$ETH % ifup $ETH % else % echo could not determine speed % fi % ethtool $ETH % #end raw ---- SPEED=`ethtool \$ETH | grep Speed | cut -d' ' -f2` if [ "\$SPEED" == "1000Mb/s" ]; then echo NIC running at 1000mb/s echo "ETHTOOL_OPTS=\"speed 1000 duplex full autoneg on\"" >> /etc/sysconfig/network-scripts/ifcfg-\$ETH echo "Resetting "\$ETH ifup \$DEV elif [ "\$SPEED" == "100Mb/s" ]; then echo NIC running at 100mb/s echo "ETHTOOL_OPTS=\"speed 100 duplex full autoneg off\"" >> /etc/sysconfig/network-scripts/ifcfg-"\$ETH" echo "Resetting "\$ETH ifup \$ETH else echo could not determine speed fi ethtool \$ETH --- Regards, -- Michael Mráka Satellite Engineering, Red Hat _______________________________________________ Spacewalk-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-list _______________________________________________ Spacewalk-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-list
