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