Optimized code quality

This commit is contained in:
Kevin Veen-Birkenbach 2019-10-01 07:55:33 +02:00
parent fd8f023801
commit 28628b5ace
5 changed files with 11 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# Core System # Core System
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](./LICENSE.txt) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](./LICENSE.txt) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6e66409513d7451b949afbf0373ba71f)](https://www.codacy.com/manual/KevinFrantz/core-system?utm_source=github.com&utm_medium=referral&utm_content=KevinFrantz/core-system&utm_campaign=Badge_Grade)
This repository contains scripts to set up an working client system, maintain it and to save the data on an USB stick. This repository contains scripts to set up an working client system, maintain it and to save the data on an USB stick.
It's adapted to the needs of Kevin Veen-Birkenbach aka. Frantz. It's adapted to the needs of Kevin Veen-Birkenbach aka. Frantz.

View File

@ -3,7 +3,7 @@
# @author Kevin Veen-Birkenbach [aka. Frantz] # @author Kevin Veen-Birkenbach [aka. Frantz]
# @param $1 If the first parameter is "reverse" the data will be exported to the system # @param $1 If the first parameter is "reverse" the data will be exported to the system
DATA_FOLDER=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data"); DATA_FOLDER=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
if [ -z $(mount | grep $DATA_FOLDER) ] if [ -z "$(mount | grep $DATA_FOLDER)" ]
then then
echo "The data folder $DATA_FOLDER is locked. You need to unlock it!" echo "The data folder $DATA_FOLDER is locked. You need to unlock it!"
bash "$(dirname "$(readlink -f "${0}")")/unlock.sh" || exit 1; bash "$(dirname "$(readlink -f "${0}")")/unlock.sh" || exit 1;
@ -26,9 +26,9 @@ do
then then
echo "The destination file allready exists!"; echo "The destination file allready exists!";
echo "Difference:" echo "Difference:"
diff $destination $source diff "$destination" "$source"
fi fi
destination_dir=$(dirname $destination) destination_dir=$(dirname "$destination")
mkdir -p "$destination_dir" mkdir -p "$destination_dir"
if [ -f "$source" ] if [ -f "$source" ]
then then

View File

@ -3,4 +3,4 @@
# @author Kevin Veen-Birkenbach [aka. Frantz] # @author Kevin Veen-Birkenbach [aka. Frantz]
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data"); DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
echo "Locking directory $DECRYPTED..." echo "Locking directory $DECRYPTED..."
fusermount -u $DECRYPTED && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED..." && rmdir $DECRYPTED fusermount -u "$DECRYPTED" && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED..." && rmdir "$DECRYPTED"

View File

@ -22,7 +22,7 @@ fi
echo "Synchronizing gui tools..." echo "Synchronizing gui tools..."
sudo pacman --needed -S gnome-shell-extensions sudo pacman --needed -S gnome-shell-extensions
echo "Install NASA picture of the day GNOME extension..." echo "Install NASA picture of the day GNOME extension..."
git clone https://github.com/Elinvention/gnome-shell-extension-nasa-apod.git $HOME/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh git clone https://github.com/Elinvention/gnome-shell-extension-nasa-apod.git "$HOME/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh"
gnome-shell-extension-tool -e nasa_apod@elinvention.ovh gnome-shell-extension-tool -e nasa_apod@elinvention.ovh
echo "Synchronizing web tools..." echo "Synchronizing web tools..."
sudo pacman --needed -S chromium firefox firefox-ublock-origin firefox-extension-https-everywhere firefox-dark-reader firefox-noscript sudo pacman --needed -S chromium firefox firefox-ublock-origin firefox-extension-https-everywhere firefox-dark-reader firefox-noscript
@ -31,6 +31,8 @@ sudo pacman --needed -S gimp
echo "Synchronizing communication tools..." echo "Synchronizing communication tools..."
yay pacman --needed -S slack-desktop skypeforlinux-stable-bin yay pacman --needed -S slack-desktop skypeforlinux-stable-bin
echo "Synchronizing development tools..." echo "Synchronizing development tools..."
echo "Synchronizing code quality tools..."
sudo pacman --needed -S shellcheck
echo "Synchronizing visualization tools..." echo "Synchronizing visualization tools..."
sudo pacman --needed -S dia sudo pacman --needed -S dia
echo "Synchronizing IDE's..." echo "Synchronizing IDE's..."
@ -62,7 +64,7 @@ sudo pacman --needed -S docker
echo "Synchronizing orchestration tools..." echo "Synchronizing orchestration tools..."
sudo pacman --needed -S ansible sudo pacman --needed -S ansible
echo "Add current user($USER) to user group docker..." echo "Add current user($USER) to user group docker..."
sudo usermod -a -G docker $USER sudo usermod -a -G docker "$USER"
echo "Enable docker service..." echo "Enable docker service..."
sudo systemctl enable docker --now sudo systemctl enable docker --now
echo "Synchronizing games..." echo "Synchronizing games..."

View File

@ -5,6 +5,6 @@ ENCRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../.encrypted");
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data"); DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
echo "Unlocking directory $DECRYPTED..." echo "Unlocking directory $DECRYPTED..."
echo "Creating directory $DECRYPTED..." echo "Creating directory $DECRYPTED..."
mkdir $DECRYPTED mkdir "$DECRYPTED"
echo "Encrypting directory $DECRYPTED to $DECRYPTED..." echo "Encrypting directory $DECRYPTED to $DECRYPTED..."
encfs $ENCRYPTED $DECRYPTED && echo "ATTENTION: DATA IS NOW DECRYPTED!" encfs "$ENCRYPTED" "$DECRYPTED" && echo "ATTENTION: DATA IS NOW DECRYPTED!"