Update security.sh
This commit is contained in:
parent
0cf406f392
commit
4308523771
74
security.sh
74
security.sh
@ -21,45 +21,61 @@ start-Everything() {
|
||||
systemctl start gdm
|
||||
}
|
||||
|
||||
while :; do
|
||||
USB_CHECK=$(blkid | grep $USB_KEY_LABEL)
|
||||
if [[ $USB_CHECK = *$USB_KEY_LABEL* ]]; then
|
||||
echo
|
||||
echo "USB Key plugged in."
|
||||
echo
|
||||
MOUNT_CHECK=$(mount | grep $KEY_LOCATION)
|
||||
if [[ $MOUNT_CHECK = *$KEY_LOCATION* ]]; then
|
||||
start() {
|
||||
while :; do
|
||||
USB_CHECK=$(blkid | grep $USB_KEY_LABEL)
|
||||
if [[ $USB_CHECK = *$USB_KEY_LABEL* ]]; then
|
||||
echo
|
||||
echo "USB Key Mounted"
|
||||
echo "USB Key plugged in."
|
||||
echo
|
||||
if [ -f "$VERACRYPT_KEY" ]; then
|
||||
MOUNT_CHECK=$(mount | grep $VERACRYPT_MOUNT_DIR)
|
||||
if [[ $MOUNT_CHECK = *$VERACRYPT_MOUNT_DIR* ]]; then
|
||||
echo
|
||||
echo "VeraCrypt already mounted."
|
||||
echo
|
||||
MOUNT_CHECK=$(mount | grep $KEY_LOCATION)
|
||||
if [[ $MOUNT_CHECK = *$KEY_LOCATION* ]]; then
|
||||
echo
|
||||
echo "USB Key Mounted"
|
||||
echo
|
||||
if [ -f "$VERACRYPT_KEY" ]; then
|
||||
MOUNT_CHECK=$(mount | grep $VERACRYPT_MOUNT_DIR)
|
||||
if [[ $MOUNT_CHECK = *$VERACRYPT_MOUNT_DIR* ]]; then
|
||||
echo
|
||||
echo "VeraCrypt already mounted."
|
||||
echo
|
||||
else
|
||||
echo
|
||||
echo "Mounting Veracrypt Volume........."
|
||||
start-Everything
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "Mounting Veracrypt Volume........."
|
||||
start-Everything
|
||||
echo "Error: Veracrypt Key not found!"
|
||||
echo
|
||||
stop-Everything
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "Error: Veracrypt Key not found!"
|
||||
echo "VeraCrypt Volume not mounted yet. Mounting now....."
|
||||
echo
|
||||
stop-Everything
|
||||
mount -L $USB_KEY_LABEL $KEY_LOCATION
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "VeraCrypt Volume not mounted yet. Mounting now....."
|
||||
echo "VeraCrypt USB Key not found! Killing Everything!"
|
||||
echo
|
||||
mount -L $USB_KEY_LABEL $KEY_LOCATION
|
||||
stop-Everything
|
||||
fi
|
||||
else
|
||||
echo
|
||||
echo "VeraCrypt USB Key not found! Killing Everything!"
|
||||
echo
|
||||
stop-Everything
|
||||
fi
|
||||
sleep 15
|
||||
done
|
||||
sleep 15
|
||||
done
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop-Everything
|
||||
}
|
||||
|
||||
if [ "$1" = "start" ]; then
|
||||
start
|
||||
elif [ "$1" = "stop" ]; then
|
||||
stop
|
||||
else
|
||||
echo
|
||||
echo "Invalid Choice"
|
||||
echo
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user