Browse Source

miaou-create locale fixed

main
pvincent 7 days ago
parent
commit
4f6117d177
  1. 33
      bin/pct-create
  2. 1
      result
  3. 17
      tools/miaou-create

33
bin/pct-create

@ -20,19 +20,19 @@ function usage {
function parse_options {
while [[ $# -gt 0 ]]; do
case "$1" in
--help | -h)
usage && exit 0
;;
--no-start)
START=false
;;
*)
if [[ -z $CONTAINER_NAME ]]; then
CONTAINER_NAME=$1
else
echo >&2 "Unknown option: $1" && usage && exit 2
fi
;;
--help | -h)
usage && exit 0
;;
--no-start)
START=false
;;
*)
if [[ -z $CONTAINER_NAME ]]; then
CONTAINER_NAME=$1
else
echo >&2 "Unknown option: $1" && usage && exit 2
fi
;;
esac
shift 1 # Move to the next argument
@ -92,7 +92,7 @@ function create_container {
--onboot true \
$(optional_public_keys) \
--unprivileged true \
--features nesting=1 \
--features nesting=1
[[ -n $TAG_NAME ]] && pct set $new_id --tags $TAG_NAME
echo "container: $CONTAINER_NAME succesfully created with vmid=$new_id!"
@ -111,9 +111,6 @@ function existing_container {
# MAIN
set -Eue
parse_options $*
parse_options "$@"
source "$CONFIG_FILE"
existing_container && false || create_container

1
result

@ -1 +0,0 @@
State: RUNNING

17
tools/miaou-create

@ -42,9 +42,20 @@ function before_start {
function after_start {
# hot changes
pct exec "$CONTAINER_ID" -- apt-get purge -y postfix
pct exec "$CONTAINER_ID" -- apt-get update
pct exec "$CONTAINER_ID" -- apt-get install -y file git bc vim jq sudo bash-completion
pct push $CONTAINER_ID <(
cat <<'EOF'
en_US.UTF-8 UTF-8
EOF
) /etc/locale.gen
pct exec "$CONTAINER_ID" -- locale-gen >/dev/null
pct exec "$CONTAINER_ID" -- bash <<EOF
echo -n 'updating...'
apt-get update >/dev/null
echo DONE
apt-get purge -y postfix
apt-get install -y file git bc vim jq sudo bash-completion
EOF
if [[ -v MIAOU_BASH_DIR ]]; then
pct exec "$CONTAINER_ID" -- /opt/miaou-bash/init.sh
fi

Loading…
Cancel
Save