diff --git a/README.md b/README.md index d340dd2..9be504f 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,10 @@ Debian12 fresh install * # log as normal user with sudo group * sudo apt install -y git * git clone https://git.artcode.re/miaou/miaou.git -* ./miaou/lib/install.sh dev +* # EITHER: + * ./miaou/lib/install.sh dev + * # OR: + * EMAIL= ./miaou/lib/install.sh dev Nested container test drive ---------------------------- @@ -63,10 +66,7 @@ Nested container test drive * CONTAINER=nested * lxc-miaou-create $CONTAINER -o sameuser,nesting * lxc sameuser $CONTAINER -* # EITHER: * /opt/miaou/lib/install.sh dev - * # OR - * EMAIL= /opt/miaou/lib/install.sh dev Hardening server ---------------- diff --git a/lib/install.sh b/lib/install.sh index 8703600..9601058 100755 --- a/lib/install.sh +++ b/lib/install.sh @@ -123,7 +123,6 @@ profiles: projects: [] cluster: null EOF - echo OK else echo "--------------------------------" echo "use dir partition for development purpose" @@ -283,7 +282,7 @@ function miaou_configfiles() { echo -n "configuration initializing ..." sudo mkdir -p /etc/miaou sudo chown "$USER" /etc/miaou - PREFIX="" echoinfo OK + PREFIX="" echoinfo DONE fi 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) 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 - PREFIX="" echoinfo OK + PREFIX="" echoinfo DONE fi if [[ ! -f /etc/miaou/miaou.yaml ]]; then echo -n "building /etc/miaou/miaou.yaml for the first time..." cp "$MIAOU_BASEDIR/templates/etc/miaou.yaml.j2" /etc/miaou/miaou.yaml - PREFIX="" echoinfo OK + PREFIX="" echoinfo DONE fi PREVIOUS_TARGET="" @@ -349,7 +348,7 @@ function miaou_resolver() { sudo chmod +x /etc/NetworkManager/dispatcher.d/50-miaou-resolver ACTIVE_CONNECTION=$(nmcli -g NAME connection show --active | head -n1) sudo nmcli connection up "$ACTIVE_CONNECTION" &>/dev/null - PREFIX="" echoinfo OK + PREFIX="" echoinfo DONE else echo "miaou-resolver in NetworkManager dispatcher already initialized!" fi @@ -358,7 +357,6 @@ function miaou_resolver() { echo -n "disabling systemd-resolved..." sudo systemctl stop systemd-resolved.service --quiet sudo systemctl disable systemd-resolved.service --quiet - sudo rm /etc/resolv.conf PREFIX="" echoinfo DONE fi @@ -419,7 +417,7 @@ function preload_bookworm_image { if [[ $(lxc image list debian/12/cloud -f csv | wc -l) -lt 1 ]]; then 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' - PREFIX="" echoinfo OK + PREFIX="" echoinfo DONE else echo -n "refreshing images from public remote..." sg $NEW_GROUP -c 'lxc image refresh debian/12/cloud --quiet' diff --git a/scripts/miaou b/scripts/miaou index 0bb157b..5ed507d 100755 --- a/scripts/miaou +++ b/scripts/miaou @@ -279,12 +279,12 @@ function build_nftables() { tera -t "$MIAOU_BASEDIR/templates/nftables/lxd.table.j2" "$EXPANDED_CONF" -o "$MIAOU_CONFIGDIR/nftables.rules.d/lxd.table" &>/dev/null fi - if ! diff -q "$MIAOU_CONFIGDIR/nftables.rules.d/lxd.table" /etc/nftables.rules.d/lxd.table; then + if ! diff -q "$MIAOU_CONFIGDIR/nftables.rules.d/lxd.table" /etc/nftables.rules.d/lxd.table &>/dev/null; then sudo_required "reloading nftables" echo -n "reloading nftables..." sudo cp "$MIAOU_CONFIGDIR/nftables.rules.d/lxd.table" /etc/nftables.rules.d/lxd.table sudo systemctl reload nftables - PREFIX="" echo OK + PREFIX="" echo DONE fi }