Commit 5e802cc8 authored by Jonathan Bryant's avatar Jonathan Bryant 💬

Update distro.sh

parent 7bef87a6
......@@ -10,6 +10,8 @@ check_penguin {
}
get_file {
check_penguin
# Workaround for the read protected files at rest.
local PATH="/mnt/stateful/lxd/devices/penguin/disk.$1.dev-.$1"
if [ -f $PATH ]; then
echo `cat $PATH`
......@@ -22,6 +24,7 @@ get_file {
values_penguin {
check_penguin
for x in ${FILES}; do
# Creates a variable named after an item in $FILES and assigns it the value of the file.
eval "$x=$(get_file $x)"
done
}
......@@ -29,15 +32,14 @@ values_penguin {
user_penguin {
check_penguin
USER=`lxc exec penguin -- ls /home`
echo "${HOME[0]}"
echo "${USER[0]}"
}
swap_penguin {
check_penguin
values_penguin
lxc stop penguin --force
lxc rename penguin stretch
run_container.sh --name="penguin" --user="$(user_penguin)" --image="$1" --lxd_remote="https://images.linuxcontainers.com" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="$authorized_keys"
}
values_penguin
run_container.sh --name="penguin" --user="$(user_penguin)" --image="$1" --lxd_remote="https://images.linuxcontainers.com" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="authorized_keys"
\ No newline at end of file
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