Skip to content

Commit

Permalink
update packager.sh to manage Ubuntu 22 Jammy LXC workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
nastasi-oq committed Jun 29, 2023
1 parent 48239ed commit b45e407
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions packager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -811,20 +811,23 @@ _lxc_name_and_ip_get()
{
local filename="$1" i e
i=-1
e=-1
for i in $(seq 1 40); do
if grep -q " as clone of $GEM_EPHEM_NAME" $filename 2>&1 ; then
lxc_name="$(grep " as clone of $GEM_EPHEM_NAME" $filename | tail -n 1 | sed "s/Created \(.*\) as clone of ${GEM_EPHEM_NAME}/\1/g")"
break
else
sleep 2
if [ "$GEM_NO_EPHEM" ]; then
lxc_name="$GEM_EPHEM_NAME"
else
i=-1
for i in $(seq 1 40); do
if grep -q " as clone of $GEM_EPHEM_NAME" "$filename" 2>&1 ; then
lxc_name="$(grep " as clone of $GEM_EPHEM_NAME" "$filename" | tail -n 1 | sed "s/Created \(.*\) as clone of ${GEM_EPHEM_NAME}/\1/g")"
break
else
sleep 2
fi
done
if [ "$i" -eq 40 ]; then
return 1
fi
done
if [ $i -eq 40 ]; then
return 1
fi
for e in $(seq 1 40); do
sleep 2
lxc_ip="$(sudo lxc-ls -f --filter "^${lxc_name}\$" | tail -n 1 | sed 's/ \+/ /g' | cut -d ' ' -f 5)"
Expand All @@ -833,7 +836,7 @@ _lxc_name_and_ip_get()
break
fi
done
if [ $e -eq 40 ]; then
if [ "$e" -eq 40 ]; then
return 1
fi
echo "SUCCESSFULLY STARTED: $lxc_name ($lxc_ip)"
Expand Down

0 comments on commit b45e407

Please sign in to comment.