Add server CLI tools installer for Ubuntu/Debian servers
Introduce a self-contained repo with an interactive install.sh that provisions zsh, oh-my-zsh, aliases, bat/yazi configs, docker shortcuts, and git-delta pager setup. Configs are adapted from dotfiles for SSH-only servers — no desktop or neovim dependencies. Installer supports --all, --update (git pull + re-run), and --uninstall with backup restore. Core packages include vim (default editor), yazi via apt, and idempotent apt installs with warnings for eza and git-delta when repos lack them.
This commit is contained in:
30
configs/custom_tools/backup_dotfiles.sh
Normal file
30
configs/custom_tools/backup_dotfiles.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO: update REPO_URL once remote is set up (Gitea or GitHub)
|
||||
REPO_URL="https://github.com/neurobrko/server_cli_tools/archive/refs/heads/main.tar.gz"
|
||||
BACKUP_DIR="$HOME/.server_cli_tools_bkp"
|
||||
DRY_RUN=false
|
||||
|
||||
if [[ "$1" == "--dry-run" ]]; then
|
||||
DRY_RUN=true
|
||||
echo "Dry run mode — no files will be moved."
|
||||
fi
|
||||
|
||||
curl -s -L "$REPO_URL" | \
|
||||
tar -tzf - | \
|
||||
grep -v '/$' | \
|
||||
while read -r file; do
|
||||
target="${file#*/}"
|
||||
|
||||
target_path="$HOME/$target"
|
||||
|
||||
if [ -f "$target_path" ]; then
|
||||
if $DRY_RUN; then
|
||||
echo "Would move $target_path to $BACKUP_DIR/$target"
|
||||
else
|
||||
echo "Moving $target_path to $BACKUP_DIR/$target"
|
||||
mkdir -p "$(dirname "$BACKUP_DIR/$target")"
|
||||
mv "$target_path" "$BACKUP_DIR/$target"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user