prerequisites() { mkdir -p -m 700 "$BASEDIR"/config # No point in testing. mkdir -p -m 700 "$BASEDIR"/temp # Old debugging config file there? [ -f "$CONFIGDIR/config" ] && cp -p "$CONFIGDIR/config" "$CONFIGDIR/config.prerun" 2>/dev/null # Let's look whether an english locale is alread active (we choose en_US.UTF-8) if [[ $(grep "en_US.UTF-8" /etc/locale.gen|cut -f 1 -d " ") == "#" ]]; then echo -n "# Generating an english UTF-8 based locale (this may take some time)..." # Backing up never hurts: cp -p /etc/locale.gen /etc/locale.gen.orig # Now patch the localization file: sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen dpkg-reconfigure locales 2>/dev/null 1>&2 if [ "$ERR" -ne 0 ]; then echo echo "# WARNING: Could not reconfigure locales. This is annoying, as" echo "# it will yield some mixed languages, perhaps." echo "# Please make sure thy system has an UTF-8 based" echo "# character set." else echo " ok." fi else echo "# English locale detected; all is well." fi } preset_mysql_root() { # Presetting a root password for mysql so installer keeps quiet: debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASS" debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASS" }