diff --git a/mybashrc b/mybashrc index 0e16404..c1a3a5a 100644 --- a/mybashrc +++ b/mybashrc @@ -1,6 +1,8 @@ #!/bin/bash # FUNCTIONS +force_color_prompt=yes + if [ "$(id -u)" != "0" ]; then IS_SUDOERS=$(groups | grep sudo) if [ -n "$(command -v sudo)" ] && [ -n "$IS_SUDOERS" ]; then @@ -657,6 +659,14 @@ _ZABBIX_UPDATE() { rm -f /tmp/zabbix.deb } +_BACK_FILE() { + if [ ! -f "$1.bak" ]; then + cp -f "$1" "$1.bak" + else + cp -f "$1" "$1_1.bak" + fi +} + # enable color support of ls and also add handy aliases # some more ls aliases #alias wp='/usr/bin/wp --allow-root' @@ -734,3 +744,4 @@ alias speedtestnet="_run _SPEEDTEST 'Installing speedtest'" alias SSETUP=_SETUP_CONTROLLER alias journalctfail='journalctl -b -p err -S "yesterday"' alias zabbix-update=_ZABBIX_UPDATE +alias bak=_BACK_FILE \ No newline at end of file