more tinkering

This commit is contained in:
kake26 2024-05-23 18:31:30 -05:00
parent 2a76825ad9
commit ca5078228f
Signed by: kake26
GPG key ID: E8AFC43591876B4D
2 changed files with 16 additions and 2 deletions

View file

@ -2,6 +2,15 @@
source ./restore.lib.bash
export DEBIAN_FRONTEND=noninteractive
# we call cp directly and check for a cp alias
cpapp=$(which cp)
if alias -p | grep -q cp; then
# we have a cp alias
unalias cp
fi
# This should help prevent any funny business
function cprint () {
color="$1"
@ -30,7 +39,7 @@ function restore_config() {
sleep 1
aptpkgfile="installed_packages"
# restore apt first
cp -Rf etc/apt/ /etc
$cpapp -Rf etc/apt/ /etc
chown -R _apt /etc/apt
apt update
apt upgrade -y
@ -51,7 +60,7 @@ function restore_config() {
fi
# we should be set app wise now the configs
cp -Rf etc/ /etc
$cpapp -Rf etc/ /etc
chown -R _apt /etc/apt
cprint 3 "You may want to reboot for changes to take effect"
cprint 2 "Done!"

View file

@ -20,3 +20,8 @@ if [ -f $pkgsum ] && [ -f $hostsum ]; then
else
echo "Checksum files not found"
fi
alias cp=moo
if alias -p | grep -q cp; then
# we have a cp alias
echo "cp alias found"
fi