From 4152887cace04372ca91eb9a4fa95dec0f32ab90 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 10 Mar 2022 10:23:53 -0500 Subject: .config/lxc: Bring back user default.conf Clean up a few lxc helpers --- .bashrc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index 26971eb..fffce01 100644 --- a/.bashrc +++ b/.bashrc @@ -92,8 +92,8 @@ alias grep='grep --color=tty -d skip' alias locate='locate -ie' alias ls='ls -hN --color=always --group-directories-first' alias lsblk='lsblk -o NAME,MAJ:MIN,RM,SIZE,FSTYPE,RO,TYPE,MOUNTPOINT,MODEL' -alias lxc-attach='lxc-attach --clear-env -n' -alias lxc-ls='lxc-ls -f' +alias lxc-attach='lxc-attach --clear-env --name' +alias lxc-ls='lxc-ls --fancy' alias lynx='lynx -cfg ~/.config/lynx/lynx.cfg' alias mocp='mocp -M $XDG_CONFIG_HOME/moc' alias newsboat='newsboat -c $XDG_CONFIG_HOME/newsboat/cache.db -u $XDG_CONFIG_HOME/newsboat/urls -C $XDG_CONFIG_HOME/newsboat/config' @@ -109,11 +109,12 @@ alias units='units --history "$XDG_CACHE_HOME"/units_history' nix-which() { readlink "$(type -P "$1")"; } # lxc helpers -lxc-copy() { A=$1 && B=$2 && shift 2 && $(type -P lxc-copy) -an "$A" -N "$B" "$@"; } -lxc-restart() { $(type -P lxc-stop) -kn "$1"; $(type -P lxc-start) -n "$1"; } -lxc-start() { for container in "$@"; do $(type -P lxc-start) -n "$container"; done } -lxc-stop() { for container in "$@"; do $(type -P lxc-stop) -kn "$container"; done } -lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) -n "$container"; done } +lxc-copy() { A=$1 && B=$2 && shift 2 && $(type -P lxc-copy) --allowrunning --name "$A" -N "$B" "$@"; } +lxc-shell() { lxc-attach "$1" -- /bin/sh -c 'export HOME="/root" && . /etc/profile && /bin/sh'; } +lxc-restart() { $(type -P lxc-stop) --kill --name "$1"; $(type -P lxc-start) -n "$1"; } +lxc-start() { for container in "$@"; do $(type -P lxc-start) --name "$container"; done } +lxc-stop() { for container in "$@"; do $(type -P lxc-stop) --kill --name "$container"; done } +lxc-destroy() { for container in "$@"; do $(type -P lxc-destroy) --name "$container"; done } # source fzf markers [ -f "$HOME/.config/fzf/marks.plugin.bash" ] && . "$HOME/.config/fzf/marks.plugin.bash" -- cgit v1.2.3