OK let continue with the package installer.
So we have a list of packages that need to be installed on a machine. Were going to read though the list and install the packages one at a time. But we also need to ignore some packages. For example we want to not install the Nvidia packages on a machine with an ATI card. Also some wireless drivers and some other kernel things. Plus you may just have some packages you don't want shared. Lets go ahead and create a file with a list of packages to be ignored.
Create the file $HOME/.coteyr_sync/ignore.packages
You will almost certainly want this list to be larger. Also note that we created a directory to hold the file. We don't want are home directory getting all cluttered and we also want these to be specific to a machine (and not synced).
Now lets go ahead and write the package installer.
so create $HOME/coteyr_sync_package_installer
Notice this time we did not call sudo in our script. So the script has to be run with sudo (or root permissions). Go ahead and run it and it will install all the packages that are on your remote machine to your local machine.
for package in `cat /tmp/install.packages`; do
for ignore in `cat $HOME/.coteyr_sync/ignore.packages`; do
if [ "$package" == "$ignore" ]; then
if [ "$noproc" != "true" ]; then
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install $package
Up till this point we have been having One system act at the "starter" of the sync. But when we want to sync more then one computer it will be a good idea to be able to start the connection from either side. Unfortunately, the scripts and what not are now synced over so making a change on the remote machine modifies settings on the local machine. This is what we want over all but we need different values for our variables on each machine. To accomplish that we will need to edit our scripts again. This is a good time to make them a bit more generic and to combine them. It's also a good time to refactor them a bit and DRY them up a bit.