save point adding exclusions
This commit is contained in:
parent
ed616685c8
commit
b154e4a448
5 changed files with 23 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./restore.lib.bash
|
||||
|
||||
function cprint () {
|
||||
color="$1"
|
||||
shift
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./restore.lib.bash
|
||||
|
||||
function cprint () {
|
||||
color="$1"
|
||||
shift
|
||||
|
@ -32,6 +34,9 @@ function restore_config() {
|
|||
apt update
|
||||
apt upgrade -y
|
||||
# now the programs installed via apt before we restore configs
|
||||
if [ -f ./exclusions ]; then
|
||||
exclusions # this runs exclusions
|
||||
fi
|
||||
apt install -y $(cat $aptpkgfile | awk '{print $1}')
|
||||
# we should be set app wise now the configs
|
||||
cp -R etc/ /etc
|
||||
|
|
11
restore.lib.bash
Normal file
11
restore.lib.bash
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Extra functions for restore scripts
|
||||
|
||||
function exclusions () {
|
||||
# rebuild installed_packages file minus those listed in the exclusions file
|
||||
|
||||
mv installed_packages installed_packages.orig
|
||||
grep -vf exclusions installed_packages.orig > installed_packages
|
||||
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
# This will be called after the bootstrap. As we need to make sure bash is present
|
||||
|
||||
source ./restore.lib.bash
|
||||
|
||||
function cprint () {
|
||||
color="$1"
|
||||
shift
|
||||
|
|
|
@ -48,6 +48,9 @@ function copy_config() {
|
|||
tmpdir=$(mktemp -d)
|
||||
echo $tmpdir
|
||||
cp -r /etc/ $tmpdir
|
||||
if [ -f ./exclusions ]; then
|
||||
cp ./exclusions $tmpdir
|
||||
fi
|
||||
if [ "$osp" = "Debian" ]; then
|
||||
dpkg --get-selections > $tmpdir/installed_packages
|
||||
cp ./restore.deb.bash $tmpdir/restore.bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue