mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-10 01:51:03 +01:00
Added base.sh and refactored
This commit is contained in:
parent
89bb5b619d
commit
24e05b6c08
5
scripts/base.sh
Normal file
5
scripts/base.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script contains the global program variables and functions
|
||||||
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
|
ENCRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../.encrypted");
|
||||||
|
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
|
@ -2,7 +2,8 @@
|
|||||||
# Imports data from the system
|
# Imports data from the system
|
||||||
# @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");
|
source "$(dirname "$(readlink -f "${0}")")/base.sh"
|
||||||
|
DATA_FOLDER=$ENCRYPTED
|
||||||
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!"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Locks the data
|
# Locks the data
|
||||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
|
source "$(dirname "$(readlink -f "${0}")")/base.sh"
|
||||||
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"
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Installs the core system
|
||||||
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
echo "Start setup of customized core software..."
|
echo "Start setup of customized core software..."
|
||||||
echo "Synchronising packages..."
|
echo "Synchronising packages..."
|
||||||
echo "Synchronizing programing languages..."
|
echo "Synchronizing programing languages..."
|
||||||
@ -57,7 +59,7 @@ apm install -c \
|
|||||||
highlight-selected\
|
highlight-selected\
|
||||||
autocomplete-paths\
|
autocomplete-paths\
|
||||||
todo-show\
|
todo-show\
|
||||||
docblockr\
|
docblockr
|
||||||
npm i -g bash-language-server #Needed by atom-package ide-bash
|
npm i -g bash-language-server #Needed by atom-package ide-bash
|
||||||
echo "Synchronizing containerization tools..."
|
echo "Synchronizing containerization tools..."
|
||||||
echo "Installing docker..."
|
echo "Installing docker..."
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Unlocks the data
|
# Unlocks the data
|
||||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
ENCRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../.encrypted");
|
source "$(dirname "$(readlink -f "${0}")")/base.sh"
|
||||||
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user