awk '$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } ' "mp=$1" "$2" ;
}
-CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
+CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -n 1`
KVER_MAJOR=$($GREP '^# Linux' $CONFIG | \
sed -r 's/.* ([0-9])\.[0-9]{1,2}\.[0-9]{1,3}.*/\1/')
if [ "$KVER_MAJOR" = "2" ]; then
lxc-wait -n $name -s RUNNING || FAIL "waiting for $template container to run"
for tries in `seq 1 20`; do
- lxcip=$(lxc-info -i -n $name -H | head -1)
+ lxcip=$(lxc-info -i -n $name -H | head -n 1)
[ -z "$lxcip" ] || break
sleep 1
done
if [ "$nics" -eq 1 ] && ! grep -q "^lxc.network.hwaddr" $path/config; then
# see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
hwaddr="fe:$(dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
- head -1 |awk '{print $2}' | cut -c1-10 |\
+ head -n 1 |awk '{print $2}' | cut -c1-10 |\
sed 's/\(..\)/\1:/g; s/.$//')"
echo "lxc.network.hwaddr = $hwaddr" >> $path/config
fi
# generate a hwaddr for the container with a high mac address
# see http://sourceforge.net/tracker/?func=detail&aid=3411497&group_id=163076&atid=826303
local hwaddr="fe:`dd if=/dev/urandom bs=8 count=1 2>/dev/null |od -t x8 | \
- head -1 |awk '{print $2}' | cut -c1-10 |\
+ head -n 1 |awk '{print $2}' | cut -c1-10 |\
sed 's/\(..\)/\1:/g; s/.$//'`"
cat <<EOF >> $cfg_dir/config || die "unable to create $cfg_dir/config"
# Container configuration for Oracle Linux $container_release_major.$container_release_minor