From ffefda6bb39757332b3902c7cb0532cd5497e8de Mon Sep 17 00:00:00 2001 From: Przemyslaw Grondek Date: Mon, 6 May 2019 17:43:23 +0200 Subject: [PATCH] Add sanitaze download folder --- sanitaze-folders.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 sanitaze-folders.sh diff --git a/sanitaze-folders.sh b/sanitaze-folders.sh new file mode 100755 index 0000000..af6d4c8 --- /dev/null +++ b/sanitaze-folders.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -d "${HOME}/Pobrane" ] +then + mkdir -p "${HOME}/Downloads" + mv ${HOME}/Pobrane/* "${HOME}/Downloads" + echo "Moved all download srom ${HOME}/Pobrane to ${HOME}/Downloads" + rmdir "${HOME}/Pobrane" + ln -s "${HOME}/Downloads" "${HOME}/Pobrane" + echo "Symlinked ${HOME}/Pobrane to ${HOME}/Downloads" +else + if [ -L "${HOME}/Pobrane" ] + then + echo "Nothing to do ${HOME}/Pobrane is already symlink" + else + ln -s "${HOME}/Downloads" "${HOME}/Pobrane" + echo "Symlinked ${HOME}/Pobrane to ${HOME}/Downloads" + fi +fi