From: xf0r3m Date: Mon, 14 Aug 2023 09:02:23 +0000 (+0200) Subject: Dostosowanie nazw wewnątrz skryptu do nowej nazwy narzędzia X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=a9f105d2d487d67db7cef4f46d27614e6159059f;p=immudex-testing.git Dostosowanie nazw wewnątrz skryptu do nowej nazwy narzędzia --- diff --git a/tools/immudex-crypt b/tools/immudex-crypt index 5ff721d..ee2c90a 100755 --- a/tools/immudex-crypt +++ b/tools/immudex-crypt @@ -13,7 +13,7 @@ function help() { echo "$ immudex_crypt list"; echo "$ immudex_crypt create "; echo "$ immudex_crypt open "; - echo "$ immudex_crypt close immudex_crypt[0-9] | ic[0-9] | [0-9]"; + echo "$ immudex_crypt close immudex-crypt[0-9] | ic[0-9] | [0-9]"; } function list() { @@ -69,24 +69,24 @@ function open() { else index=0; fi - sudo cryptsetup open $1 immudex_crypt${index}; - sudo mkdir -p /media/${USER}/immudex_crypt${index}; - dmDevice=$(ls -l /dev/mapper/immudex_crypt${index} | awk '{printf $10}' | cut -d "/" -f 2); + sudo cryptsetup open $1 immudex-crypt${index}; + sudo mkdir -p /media/${USER}/immudex-crypt${index}; + dmDevice=$(ls -l /dev/mapper/immudex-crypt${index} | awk '{printf $10}' | cut -d "/" -f 2); if ! $(sudo file -s /dev/${dmDevice} | grep -q 'ext4'); then echo "Could not determine filesystem of unlocked device."; echo -n "Format this device to ext4? (y/n): " read format; if [ "$format" = "y" ]; then - sudo mkfs.ext4 /dev/mapper/immudex_crypt${index}; + sudo mkfs.ext4 /dev/mapper/immudex-crypt${index}; else echo "Refuse to mount."; - sudo cryptsetup close immudex_crypt${index}; + sudo cryptsetup close immudex-crypt${index}; exit 1; fi fi - sudo mount /dev/mapper/immudex_crypt${index} /media/${USER}/immudex_crypt${index}; + sudo mount /dev/mapper/immudex-crypt${index} /media/${USER}/immudex-crypt${index}; if [ ! -e /ic${index} ]; then - sudo ln -s /media/${USER}/immudex_crypt${index} /ic${index}; + sudo ln -s /media/${USER}/immudex-crypt${index} /ic${index}; fi fi @@ -97,9 +97,9 @@ function close() { if [ $# -lt 1 ]; then help; exit 1; else if [ $1 -ge 0 ] 2> /dev/null; then - cryptfsName="immudex_crypt${1}"; + cryptfsName="immudex-crypt${1}"; elif echo $1 | grep -q 'ic'; then - cryptfsName="immudex_crypt$(echo $1 | grep -o '[0-9]')"; + cryptfsName="immudex-crypt$(echo $1 | grep -o '[0-9]')"; else cryptfsName=$1; fi