From 48721f7be660c3cc022edc81cd07d14fe5df1a40 Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" Date: Thu, 7 Mar 2024 16:53:07 +0530 Subject: [PATCH] =?UTF-8?q?@eshanized:=20push=20via=20push.sh=20?= =?UTF-8?q?=F0=9F=8E=89=20!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/local/bin/skel | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 usr/local/bin/skel diff --git a/usr/local/bin/skel b/usr/local/bin/skel new file mode 100644 index 0000000..71bd461 --- /dev/null +++ b/usr/local/bin/skel @@ -0,0 +1,35 @@ +#!/bin/bash + +echo "Copy contents from /etc/skel to Home directory? (Y/n)" +read -r 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 \ No newline at end of file