# automatically add group, with or without specified gid (not for use at SBo) if ! grep "^bumblebee:" etc/group 1> /dev/null 2> /dev/null ; then if ! grep ":261:" etc/group 1> /dev/null 2> /dev/null ; then chroot . groupadd -g 261 bumblebee else chroot . groupadd bumblebee fi fi config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/bumblebee/bumblebee.conf.new config etc/bumblebee/xorg.conf.nouveau.new config etc/bumblebee/xorg.conf.nvidia.new config etc/rc.d/rc.bumblebeed.new