fixlocale/fixlocale.sh

13 lines
369 B
Bash
Raw Permalink Normal View History

2020-05-25 16:58:51 -05:00
#!/bin/sh
if (locale 2>&1 | grep "locale: Cannot set"); then
if ! [ "$(id -u)" -eq 0 ]; then
echo "Locales is broken, but you must be root to fix"
exit 1
fi
echo "Fixing Locales"
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8 UTF-8
dpkg-reconfigure --frontend=noninteractive locales
fi