#!/bin/bash
# License: GPL
# Author: Steven Shiau <steven _at_ clonezilla org>
# Description: This program reset the keymap and language settings in Clonezilla live environment.

DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
. $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
. /etc/drbl/drbl-ocs.conf
. $DRBL_SCRIPT_PATH/sbin/ocs-functions

# Load the config in ocs-live.conf. This is specially for Clonezilla live.
# It will overwrite some settings of /etc/drbl/drbl-ocs.conf, such as $DIA...
[ -e "/etc/ocs/ocs-live.conf" ] && . /etc/ocs/ocs-live.conf

check_if_root

echo -n "Cleaning ocs_lang and live_keyboard_layouts in /etc/ocs/ocs-live.conf... "
sed -i "s|^ocs_lang=.*|ocs_lang=|g" /etc/ocs/ocs-live.conf
sed -i "s|^live_keyboard_layouts=.*|live_keyboard_layouts=|g" /etc/ocs/ocs-live.conf
echo "done!"

echo "Removing files under /run/live... "
rm -fv /run/live/ocs-lang-kbd-conf /run/live/drbl-kbdchooser /run/live/drbl-langchooser
echo "done!"

