Commit 7b40534f authored by Jonathan Bryant's avatar Jonathan Bryant 💬

Update distro.sh

parent 6ca76c41
......@@ -36,13 +36,24 @@ user_penguin() {
echo "${USER[0]}"
}
mod_run() {
# Bastardized method of getting around file permissions.
if [ -f /mnt/stateful/lxd_conf/run_container.sh ]; then rm /mnt/stateful/lxd_conf/run_container.sh; fi
/bin/cp /usr/bin/run_container.sh /mnt/stateful/lxd_conf/run_container.sh
sed 's/\/run\/tokens/\/mnt\/stateful\/lxd_conf\/tokens/' -i /mnt/stateful/lxd_conf/run_container.sh
mkdir /mnt/stateful/lxd_conf/tokens
sed 's/\/run\/sshd/\/mnt\/stateful\/lxd_conf\/sshd/' -i /mnt/stateful/lxd_conf/run_container.sh
mkdir /mnt/stateful/lxd_conf/sshd
}
swap_penguin() {
check_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" --lxd_image="$1" --lxd_remote="https://images.linuxcontainers.com" --container_token="$container_token" --host_public_key="$ssh_host_key" --guest_private_key="$authorized_keys"
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"
}
check_penguin
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