|
@ -123,7 +123,6 @@ profiles: |
|
|
projects: [] |
|
|
projects: [] |
|
|
cluster: null |
|
|
cluster: null |
|
|
EOF |
|
|
EOF |
|
|
echo OK |
|
|
|
|
|
else |
|
|
else |
|
|
echo "--------------------------------" |
|
|
echo "--------------------------------" |
|
|
echo "use dir partition for development purpose" |
|
|
echo "use dir partition for development purpose" |
|
@ -283,7 +282,7 @@ function miaou_configfiles() { |
|
|
echo -n "configuration initializing ..." |
|
|
echo -n "configuration initializing ..." |
|
|
sudo mkdir -p /etc/miaou |
|
|
sudo mkdir -p /etc/miaou |
|
|
sudo chown "$USER" /etc/miaou |
|
|
sudo chown "$USER" /etc/miaou |
|
|
PREFIX="" echoinfo OK |
|
|
|
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [[ ! -f /etc/miaou/defaults.yaml ]]; then |
|
|
if [[ ! -f /etc/miaou/defaults.yaml ]]; then |
|
@ -291,13 +290,13 @@ function miaou_configfiles() { |
|
|
shadow_passwd=$(sudo grep "$CURRENT_USER" /etc/shadow | cut -d ':' -f2) |
|
|
shadow_passwd=$(sudo grep "$CURRENT_USER" /etc/shadow | cut -d ':' -f2) |
|
|
env current_user="$CURRENT_USER" shadow_passwd="$shadow_passwd" valid_email="$valid_email" tera -e --env-key env --env-only -t "$MIAOU_BASEDIR/templates/etc/defaults.yaml.j2" -o /etc/miaou/defaults.yaml >/dev/null |
|
|
env current_user="$CURRENT_USER" shadow_passwd="$shadow_passwd" valid_email="$valid_email" tera -e --env-key env --env-only -t "$MIAOU_BASEDIR/templates/etc/defaults.yaml.j2" -o /etc/miaou/defaults.yaml >/dev/null |
|
|
yq ".target=\"$TARGET\"" /etc/miaou/defaults.yaml -i |
|
|
yq ".target=\"$TARGET\"" /etc/miaou/defaults.yaml -i |
|
|
PREFIX="" echoinfo OK |
|
|
|
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [[ ! -f /etc/miaou/miaou.yaml ]]; then |
|
|
if [[ ! -f /etc/miaou/miaou.yaml ]]; then |
|
|
echo -n "building /etc/miaou/miaou.yaml for the first time..." |
|
|
echo -n "building /etc/miaou/miaou.yaml for the first time..." |
|
|
cp "$MIAOU_BASEDIR/templates/etc/miaou.yaml.j2" /etc/miaou/miaou.yaml |
|
|
cp "$MIAOU_BASEDIR/templates/etc/miaou.yaml.j2" /etc/miaou/miaou.yaml |
|
|
PREFIX="" echoinfo OK |
|
|
|
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
PREVIOUS_TARGET="" |
|
|
PREVIOUS_TARGET="" |
|
@ -349,7 +348,7 @@ function miaou_resolver() { |
|
|
sudo chmod +x /etc/NetworkManager/dispatcher.d/50-miaou-resolver |
|
|
sudo chmod +x /etc/NetworkManager/dispatcher.d/50-miaou-resolver |
|
|
ACTIVE_CONNECTION=$(nmcli -g NAME connection show --active | head -n1) |
|
|
ACTIVE_CONNECTION=$(nmcli -g NAME connection show --active | head -n1) |
|
|
sudo nmcli connection up "$ACTIVE_CONNECTION" &>/dev/null |
|
|
sudo nmcli connection up "$ACTIVE_CONNECTION" &>/dev/null |
|
|
PREFIX="" echoinfo OK |
|
|
|
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
else |
|
|
else |
|
|
echo "miaou-resolver in NetworkManager dispatcher already initialized!" |
|
|
echo "miaou-resolver in NetworkManager dispatcher already initialized!" |
|
|
fi |
|
|
fi |
|
@ -358,7 +357,6 @@ function miaou_resolver() { |
|
|
echo -n "disabling systemd-resolved..." |
|
|
echo -n "disabling systemd-resolved..." |
|
|
sudo systemctl stop systemd-resolved.service --quiet |
|
|
sudo systemctl stop systemd-resolved.service --quiet |
|
|
sudo systemctl disable systemd-resolved.service --quiet |
|
|
sudo systemctl disable systemd-resolved.service --quiet |
|
|
sudo rm /etc/resolv.conf |
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
PREFIX="" echoinfo DONE |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -419,7 +417,7 @@ function preload_bookworm_image { |
|
|
if [[ $(lxc image list debian/12/cloud -f csv | wc -l) -lt 1 ]]; then |
|
|
if [[ $(lxc image list debian/12/cloud -f csv | wc -l) -lt 1 ]]; then |
|
|
echo -n "downloading images from public remote, please hold on..." |
|
|
echo -n "downloading images from public remote, please hold on..." |
|
|
sg $NEW_GROUP -c 'lxc image copy images:debian/12/cloud local: --copy-aliases --quiet' |
|
|
sg $NEW_GROUP -c 'lxc image copy images:debian/12/cloud local: --copy-aliases --quiet' |
|
|
PREFIX="" echoinfo OK |
|
|
|
|
|
|
|
|
PREFIX="" echoinfo DONE |
|
|
else |
|
|
else |
|
|
echo -n "refreshing images from public remote..." |
|
|
echo -n "refreshing images from public remote..." |
|
|
sg $NEW_GROUP -c 'lxc image refresh debian/12/cloud --quiet' |
|
|
sg $NEW_GROUP -c 'lxc image refresh debian/12/cloud --quiet' |
|
|