Files
snigdhaos-system-config/usr/local/bin/skel
2024-08-01 04:32:49 +05:30

36 lines
633 B
Bash
Executable File

#!/bin/bash
echo "Copy contents from /etc/skel to Home directory? (Y/n)"
# shellcheck disable=SC2162
read response
if [[ "$response" == [yY] ]]; then
time=$(date +%Y.%m.%d-%H.%M.%S)
if [ ! -d ~/.config ]; then
mkdir ~/.config
fi
echo
# shellcheck disable=SC2086
echo "Backing up .config folder to ~/.config-backup-"$time
echo
# shellcheck disable=SC2086
cp -Rf ~/.config ~/.config-backup-$time
echo
echo "Overwriting existing .config folder with the files from /etc/skel"
echo
# shellcheck disable=SC2086
cp -r /etc/skel/. $HOME
echo
echo "Task Completed!"
echo
else
echo
echo "No change!"
echo
fi