Commit 9a9e1c57 authored by Jonathan Bryant's avatar Jonathan Bryant 💬

Update distro.sh

parent 871061ae
......@@ -10,8 +10,13 @@ check_penguin() {
}
get_file() {
# All ssh mounts have an added term.
if [ -z "$(echo $x | /bin/grep 'ssh')" ]; then
local PATH="/mnt/stateful/lxd/devices/penguin/disk.$1.dev-.ssh-$1"
else
local PATH="/mnt/stateful/lxd/devices/penguin/disk.$1.dev-.$1"
fi
# Workaround for the read protected files at rest.
local PATH="/mnt/stateful/lxd/devices/penguin/disk.$1.dev-.$1"
if [ -f $PATH ]; then
echo "$(/bin/cat $PATH)"
else
......@@ -28,15 +33,16 @@ values_penguin() {
}
user_penguin() {
USER="$(/usr/bin/lxc exec penguin -- ls /home)"
local USER="$(/usr/bin/lxc exec penguin -- ls /home)"
echo "${USER[0]}"
}
swap_penguin() {
values_penguin
local USER="$(user_penguin)"
/usr/bin/lxc stop penguin --force
/usr/bin/lxc rename penguin stretch
/usr/bin/run_container.sh --container_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"
/usr/bin/run_container.sh --container_name="penguin" --user="$USER" --image="$1" --lxd_remote="https://images.linuxcontainers.com" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="$authorized_keys"
}
check_penguin
......
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