1
1

Unify device naming convention

This commit is contained in:
Derek Smith 2023-03-19 13:49:00 -04:00
parent ab08923543
commit 9e7d9d3a90
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
2 changed files with 9 additions and 7 deletions

View File

@ -96,12 +96,12 @@ if ! lxc list --format csv | grep -q ss-mgmt; then
lxc init "images:$BASE_LXC_IMAGE" ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default
# mount the pre-verified sovereign stack git repo into the new vm
lxc config device add ss-mgmt sscode disk source="$(pwd)" path=/home/ubuntu/sovereign-stack
lxc config device add ss-mgmt ss-code disk source="$(pwd)" path=/home/ubuntu/sovereign-stack
# if the System Owner has a ~/.ss directory, then we'll mount it into the vm
# this allows the data to persist across ss-mgmt vms; ie. install/uninstall
if [ -d "$SS_ROOT_PATH" ]; then
lxc config device add ss-mgmt ssroot disk source="$SS_ROOT_PATH" path=/home/ubuntu/.ss
lxc config device add ss-mgmt ss-root disk source="$SS_ROOT_PATH" path=/home/ubuntu/.ss
fi
# if a ~/.bitcoin/testnet3/blocks direrectory exists, mount it in.

View File

@ -32,13 +32,15 @@ if lxc list --format csv | grep -q "ss-mgmt"; then
lxc stop ss-mgmt
fi
lxc config device remove ss-mgmt sscode
if [ -d "$SS_ROOT_PATH" ]; then
lxc config device remove ss-mgmt ssroot
if lxc config device list ss-mgmt -q | grep -q "ss-code"; then
lxc config device remove ss-mgmt ss-code
fi
if [ -d "$HOME/.ssh" ]; then
if lxc config device list ss-mgmt -q | grep -q "ss-root"; then
lxc config device remove ss-mgmt ss-root
fi
if lxc config device list ss-mgmt -q | grep -q "ss-ssh"; then
lxc config device remove ss-mgmt ss-ssh
fi