change debian-bash to miaou-bash
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ use() {
|
||||
create() {
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
source /opt/debian-bash/lib/functions.sh
|
||||
source /opt/miaou-bash/lib/functions.sh
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
mapfile -t DBs < <(list)
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ use() {
|
||||
|
||||
create() {
|
||||
echo >&2 "about to create to <${DB_NAME}> ..."
|
||||
source /opt/debian-bash/lib/functions.sh
|
||||
source /opt/miaou-bash/lib/functions.sh
|
||||
local DBs=($(list))
|
||||
if ! $(containsElement DBs $DB_NAME); then
|
||||
local SQL="CREATE USER \\\\\\\"$DB_NAME\\\\\\\" WITH PASSWORD '$DB_PASSWORD'"
|
||||
|
||||
@@ -105,8 +105,8 @@ EOF
|
||||
|
||||
lxc config device add "$CONTAINER" SHARED disk source="$HOME/LXD/SHARED/$CONTAINER" path=/mnt/SHARED -q
|
||||
lxc config device add "$CONTAINER" TOOLBOX disk source=/TOOLBOX path=/TOOLBOX -q
|
||||
lxc config device add "$CONTAINER" DEBIAN_BASH disk source=$(realpath /opt/debian-bash) path=/opt/debian-bash -q
|
||||
lxc config set "$CONTAINER" environment.PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/debian-bash/tools:/TOOLBOX -q
|
||||
lxc config device add "$CONTAINER" DEBIAN_BASH disk source=$(realpath /opt/miaou-bash) path=/opt/miaou-bash -q
|
||||
lxc config set "$CONTAINER" environment.PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/miaou-bash/tools:/TOOLBOX -q
|
||||
|
||||
if [[ "$OPTION_NESTING" == true ]]; then
|
||||
lxc config set $CONTAINER security.nesting true -q
|
||||
@@ -115,8 +115,8 @@ EOF
|
||||
|
||||
lxc start "$CONTAINER" -q
|
||||
|
||||
# initializing debian-bash
|
||||
lxc exec "$CONTAINER" -- /opt/debian-bash/init.sh
|
||||
# initializing miaou-bash
|
||||
lxc exec "$CONTAINER" -- /opt/miaou-bash/init.sh
|
||||
|
||||
# default configuration files (btm,)
|
||||
lxc exec "$CONTAINER" -- mkdir -p /root/.config/bottom
|
||||
@@ -141,12 +141,12 @@ EOF
|
||||
if ! lxc exec "$CONTAINER" -- passwd -S "$miaou_user" | cut -d ' ' -f2 | grep -q ^P; then
|
||||
shadow_passwd=$(load_yaml_from_expanded credential.shadow)
|
||||
shadow_remainder=$(lxc exec "$CONTAINER" -- bash -c "grep $miaou_user /etc/shadow | cut -d':' -f3-")
|
||||
lxc exec "$CONTAINER" -- /opt/debian-bash/tools/append_or_replace "^$miaou_user:.*:" "$miaou_user:$shadow_passwd:$shadow_remainder" /etc/shadow >/dev/null
|
||||
lxc exec "$CONTAINER" -- /opt/miaou-bash/tools/append_or_replace "^$miaou_user:.*:" "$miaou_user:$shadow_passwd:$shadow_remainder" /etc/shadow >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$OPTION_SSH" == true ]]; then
|
||||
lxc exec "$CONTAINER" -- /opt/debian-bash/tools/idem_apt_install openssh-server
|
||||
lxc exec "$CONTAINER" -- /opt/miaou-bash/tools/idem_apt_install openssh-server
|
||||
fi
|
||||
|
||||
if [[ "$OPTION_SSH" == true && "$OPTION_SAMEUSER" == true ]]; then
|
||||
|
||||
@@ -34,9 +34,9 @@ EOF
|
||||
miaou_user=$(whoami)
|
||||
shadow_passwd=$(load_yaml_from_expanded credential.shadow)
|
||||
shadow_remainder=$(lxc exec "$CONTAINER" -- bash -c "grep $SSH_USER /etc/shadow | cut -d':' -f3-")
|
||||
lxc exec "$CONTAINER" -- /opt/debian-bash/tools/append_or_replace "^$SSH_USER:.*:" "$SSH_USER:$shadow_passwd:$shadow_remainder" /etc/shadow >/dev/null
|
||||
lxc exec "$CONTAINER" -- /opt/miaou-bash/tools/append_or_replace "^$SSH_USER:.*:" "$SSH_USER:$shadow_passwd:$shadow_remainder" /etc/shadow >/dev/null
|
||||
|
||||
lxc exec "$CONTAINER" -- /opt/debian-bash/tools/idem_apt_install openssh-server
|
||||
lxc exec "$CONTAINER" -- /opt/miaou-bash/tools/idem_apt_install openssh-server
|
||||
previous_users=($(
|
||||
lxc exec "$CONTAINER" -- bash <<EOF
|
||||
set -Eeuo pipefail
|
||||
|
||||
Reference in New Issue
Block a user