Refactor script
This commit is contained in:
parent
37a854cd1c
commit
4e68455f3b
|
@ -1,17 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Loading selections for file:"
|
||||
SELECTIONS="$(cat "$FAI/debconf/HW4F_DESKTOP")"
|
||||
echo -e '\nDebconf for package 'keyboard-configuration' pre:'
|
||||
debconf-show "keyboard-configuration"
|
||||
|
||||
echo -e "Setting selections:\n"
|
||||
echo -e '\nLoading selections for file:'
|
||||
SELECTIONS="$(cat "/tmp/debconf.txt")"
|
||||
|
||||
echo -e '\nSetting selections:'
|
||||
$ROOTCMD debconf-set-selections -v <<< "$SELECTIONS"
|
||||
|
||||
### WORK AROUND A BUG IN UBUNTU WHICH IGNORES DEBCONF
|
||||
XKBMODEL="$(grep "keyboard-configuration/modelcode" <<< "$SELECTIONS")"
|
||||
XKBLAYOUT="$(grep "keyboard-configuration/layoutcode" <<< "$SELECTIONS")"
|
||||
XKBVARIANT="$(grep "keyboard-configuration/variantcode" <<< "$SELECTIONS")"
|
||||
XKBOPTIONS="$(grep "keyboard-configuration/optionscode" <<< "$SELECTIONS")"
|
||||
|
||||
$ROOTCMD cat <<EOF > /etc/default/keyboard
|
||||
# KEYBOARD CONFIGURATION FILE
|
||||
|
||||
# Consult the keyboard(5) manual page.
|
||||
|
||||
XKBMODEL="$XKBMODEL"
|
||||
XKBLAYOUT="$XKBLAYOUT"
|
||||
XKBVARIANT="$XKBVARIANT"
|
||||
XKBOPTIONS="$XKBOPTIONS"
|
||||
|
||||
BACKSPACE="guess"
|
||||
EOF
|
||||
|
||||
### RECONFIGURE PACKAGES
|
||||
PACKAGES="$(awk '{print $1}' <<< "$SELECTIONS" | sort -u)"
|
||||
for PACKAGE in $PACKAGES; do
|
||||
echo -e '\n'"Reconfiguring package '$PACKAGE'"
|
||||
$ROOTCMD dpkg-reconfigure -f noninteractive "$PACKAGE"
|
||||
|
||||
echo "Debconf for package '$PACKAGE'"
|
||||
$ROOTCMD debconf-show "$PACKAGE"
|
||||
|
||||
echo "Reconfiguring package '$PACKAGE'"
|
||||
$ROOTCMD dpkg-reconfigure "$PACKAGE"
|
||||
echo -e '\n'"Debconf for package '$PACKAGE' post:"
|
||||
$ROOTCMD debconf-show "$PACKAGE"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue