diff --git a/debian/debian-essentials.sh b/debian/debian-essentials.sh index 8ecbb9f..a3ff0dc 100755 --- a/debian/debian-essentials.sh +++ b/debian/debian-essentials.sh @@ -179,6 +179,22 @@ if [[ -f /etc/apt/keyrings/docker.gpg ]] echo "alias lzd='lazydocker'" >> /etc/bash.bashrc fi +# create copy of file before editing +if [[ ! -f /usr/local/bin/cpb ]]; then +cat <<'EOF' >> /usr/local/bin/cpb +#!/bin/bash + +if [ $# -eq 1 ] +then + cp -pvi "$1" "${1}.bak" +else + echo "Info: $0 copies to a backup file" + echo "Usage: $0 " +fi +EOF +chmod +x /usr/local/bin/cpb +fi + # create tmux config rm /etc/tmux.conf* > /dev/null 2>&1 echo "unbind C-b" >> /etc/tmux.conf