Skip to content

Instantly share code, notes, and snippets.

@timconradinc
Created July 25, 2014 21:23
Show Gist options
  • Save timconradinc/e1a697792cb132890884 to your computer and use it in GitHub Desktop.
Save timconradinc/e1a697792cb132890884 to your computer and use it in GitHub Desktop.
fpm install
#!/bin/bash
# source $(pwd)/config.sh
GRUB_CONFIG="/etc/default/grub"
GRUB_TEMPLATE="/data/company/company-grub/src/grub-default"
GRUB_BACKUP="/data/company/company-grub/bak/grub-default-config"
# the grub default should always exist, but just in case.
if [ -f ${GRUB_CONFIG} ] ; then
# copy a backup in the /etc/default directory
cp -v ${GRUB_CONFIG} "${GRUB_CONFIG}.company-bak"
# copy it to the package backup directory
cp -v ${GRUB_CONFIG} ${GRUB_BACKUP}
fi
if [ -f ${GRUB_TEMPLATE} ] ; then
if [ -f ${GRUB_CONFIG} ] ; then
rm ${GRUB_CONFIG}
fi
# copy this version of the configuration and update grub to
# reflect it.
cp -v ${GRUB_TEMPLATE} ${GRUB_CONFIG} && update-grub
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment