Commit a8f19251 authored by Jonathan Bryant's avatar Jonathan Bryant 💬

Update distro.sh

parent 7b40534f
......@@ -4,7 +4,16 @@ FILES="ssh_authorized_keys ssh_host_key container_token"
check_penguin() {
if [ -z "$(/usr/bin/lxc ls | /bin/grep 'penguin | RUNNING')" ]; then
echo "Opps. Penguin is not running. This might be fixable by just running: lxc start penguin"
if [ -n "$(/usr/bin/lxc ls | /bin/grep 'penguin_old')" ]; then
/usr/bin/lxc rename penguin_old penguin
/usr/bin/lxc start penguin
if [ -n "$?" ]; then
echo "Something went wrong with trying to recover penguin."
exit 1
fi
else
echo "Looks like penguin_old is gone. You might want to reinstall linux on chrome."
fi
exit 1
fi
}
......@@ -51,9 +60,9 @@ swap_penguin() {
values_penguin
local USER="$(user_penguin)"
/usr/bin/lxc stop penguin --force
/usr/bin/lxc rename penguin stretch
/usr/bin/lxc rename penguin penguin_old
mod_run
/mnt/stateful/lxd_conf/run_container.sh --container_name="penguin" --user="$USER" --lxd_image="$1" --lxd_remote="https://images.linuxcontainers.com" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="$authorized_keys"
/mnt/stateful/lxd_conf/run_container.sh --container_name="penguin" --user="$USER" --lxd_image="$1" --lxd_remote="https://images.linuxcontainers.org:8443" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="$authorized_keys"
}
swap_penguin $1
\ No newline at end of file
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 to comment