#!/bin/sh fix_ifaces_file(){ IFACES=`ls /sys/class/net|egrep -v '^lo$'` I=0 cp /etc/network/interfaces /etc/network/interfaces.lliurex-grub-custom-backup for x in $IFACES; do echo " [ LLiureX Grub Custom ] : Fixing ${x} into /etc/network/interfaces" sed -i "s%${x}%eth${I}%g" /etc/network/interfaces || echo "Not found interface ${x} into /etc/network/interfaces" I=$(($I+1)) done } regenerate(){ # To clean initramfs scripts if type update-initramfs >/dev/null 2>&1; then update-initramfs -u || true fi update-grub2 || true } ##### GRUB_DEFCFG_DIR="/etc/default/grub.d" #DISTRIBUTION="Lliurex Xenial" ####Needed by EFI signed application### DISTRIBUTION="Ubuntu" ####################################### GFXMODE="1024x768" HIDDEN_TIMEOUT_QUIET="true" HIDDEN_TIMEOUT="" GRUB_BACKGROUND="/usr/share/lliurex-grub-custom/backgrounds/xenial.png" CMDLINE="net.ifnames=0 quiet splash rw" DISTRIBUTION_FILE="01-lliurex-distributor.cfg" GFXMODE_FILE="02-lliurex-gfxmode.cfg" HIDDEN_TIMEOUT_QUIET_FILE="03-lliurex-hidden-timeout-quiet.cfg" HIDDEN_TIMEOUT_FILE="04-lliurex-hidden-timeout.cfg" GRUB_BACKGROUND_FILE="05-lliurex-background.cfg" CMDLINE_FILE="06-lliurex-cmdline.cfg" case $1 in configure) if [ ! -d ${GRUB_DEFCFG_DIR} ]; then mkdir ${GRUB_DEFCFG_DIR} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${DISTRIBUTION_FILE} ]; then echo "GRUB_DISTRIBUTOR=\"${DISTRIBUTION}\"" >> ${GRUB_DEFCFG_DIR}/${DISTRIBUTION_FILE} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${GFXMODE_FILE} ]; then echo "GRUB_GFXMODE=${GFXMODE}" >> ${GRUB_DEFCFG_DIR}/${GFXMODE_FILE} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_QUIET_FILE} ]; then echo "GRUB_HIDDEN_TIMEOUT_QUIET=${HIDDEN_TIMEOUT_QUIET}" >> ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_QUIET_FILE} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_FILE} ]; then echo "GRUB_HIDDEN_TIMEOUT=${HIDDEN_TIMEOUT}" >> ${GRUB_DEFCFG_DIR}/${HIDDEN_TIMEOUT_FILE} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${GRUB_BACKGROUND_FILE} ]; then echo "GRUB_BACKGROUND=\"${GRUB_BACKGROUND}\"" >> ${GRUB_DEFCFG_DIR}/${GRUB_BACKGROUND_FILE} fi if [ ! -f ${GRUB_DEFCFG_DIR}/${CMDLINE_FILE} ]; then echo "GRUB_CMDLINE_LINUX_DEFAULT=\"${CMDLINE}\"" >> ${GRUB_DEFCFG_DIR}/${CMDLINE_FILE} fi fix_ifaces_file regenerate ;; *) echo "Nothing to do" ;; esac #DEBHELPER#