diff --git a/functions/awit.sh b/scripts/awit.sh similarity index 100% rename from functions/awit.sh rename to scripts/awit.sh diff --git a/functions/del_logs.sh b/scripts/del_logs.sh similarity index 100% rename from functions/del_logs.sh rename to scripts/del_logs.sh diff --git a/scripts/kan b/scripts/kan new file mode 100755 index 0000000..4f7a725 --- /dev/null +++ b/scripts/kan @@ -0,0 +1,36 @@ +#!/bin/bash + + +current_tty=$(tty) + +ttys=$(ps aux | grep "$(basename "$SHELL")$" | grep "^$USER\s" | awk '{print("/dev/"$7)}' | grep -v "$current_tty") + +while getopts ":l :d :c :s" opt; do + + # shellcheck disable=SC2213 + case $opt in + l) + echo -e "$current_tty - Current\n$ttys" | sort + ;; + d) + for i in $ttys + do + echo -e "\nkan: detect: $i" > "$i" & + done + ;; + c) + echo "$current_tty" + ;; + s) + read -r input_text + for i in $ttys + do + echo "$input_text" > "$i" + done + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + ;; + esac +done + diff --git a/functions/luks.sh b/scripts/luks.sh similarity index 100% rename from functions/luks.sh rename to scripts/luks.sh