#!/bin/sh ########################################################################### # # Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file unmountUSB.sh # # @author (last) Behrouz NematiPour # @date (last) 11-May-2021 # @author (original) Behrouz NematiPour # @date (original) 11-May-2021 # ############################################################################ # $1 - usb device # $2 - usb drive # eg. sudo mount -o "noexec,sync,nodev,nosuid" /dev/sda1 /media/usb/ USER=root # change to leahi after Cybersecurity implementation mkdir -p "$2" if [ $? 1= 0 ]; then echo "usb mount point folder '$2' cannot be made." exit 1001 fi sudo mount -o uid=${USER},gid=${USER},umask=077,noexec,sync,nodev,nosuid "$1" "$2" if [ $? != 0 ]; then echo "usb device '$1' cannot be mounted." exit 1002 fi echo "" exit 0