From ca5078228f9b2afcb57ccf2ee250167cda0cf546 Mon Sep 17 00:00:00 2001 From: kake26 Date: Thu, 23 May 2024 18:31:30 -0500 Subject: [PATCH] more tinkering --- restore.deb.bash | 13 +++++++++++-- verify.bash | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/restore.deb.bash b/restore.deb.bash index eca77d2..b8d5fa2 100755 --- a/restore.deb.bash +++ b/restore.deb.bash @@ -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!" diff --git a/verify.bash b/verify.bash index 9579cdc..72c1a9f 100644 --- a/verify.bash +++ b/verify.bash @@ -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 \ No newline at end of file