more tinkering
This commit is contained in:
parent
2a76825ad9
commit
ca5078228f
2 changed files with 16 additions and 2 deletions
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
source ./restore.lib.bash
|
source ./restore.lib.bash
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
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 () {
|
function cprint () {
|
||||||
color="$1"
|
color="$1"
|
||||||
|
@ -30,7 +39,7 @@ function restore_config() {
|
||||||
sleep 1
|
sleep 1
|
||||||
aptpkgfile="installed_packages"
|
aptpkgfile="installed_packages"
|
||||||
# restore apt first
|
# restore apt first
|
||||||
cp -Rf etc/apt/ /etc
|
$cpapp -Rf etc/apt/ /etc
|
||||||
chown -R _apt /etc/apt
|
chown -R _apt /etc/apt
|
||||||
apt update
|
apt update
|
||||||
apt upgrade -y
|
apt upgrade -y
|
||||||
|
@ -51,7 +60,7 @@ function restore_config() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# we should be set app wise now the configs
|
# we should be set app wise now the configs
|
||||||
cp -Rf etc/ /etc
|
$cpapp -Rf etc/ /etc
|
||||||
chown -R _apt /etc/apt
|
chown -R _apt /etc/apt
|
||||||
cprint 3 "You may want to reboot for changes to take effect"
|
cprint 3 "You may want to reboot for changes to take effect"
|
||||||
cprint 2 "Done!"
|
cprint 2 "Done!"
|
||||||
|
|
|
@ -20,3 +20,8 @@ if [ -f $pkgsum ] && [ -f $hostsum ]; then
|
||||||
else
|
else
|
||||||
echo "Checksum files not found"
|
echo "Checksum files not found"
|
||||||
fi
|
fi
|
||||||
|
alias cp=moo
|
||||||
|
if alias -p | grep -q cp; then
|
||||||
|
# we have a cp alias
|
||||||
|
echo "cp alias found"
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue