From 3b75c9ac1210829620ead1874dd5746f091bb198 Mon Sep 17 00:00:00 2001 From: David Houdek Date: Mon, 9 Oct 2023 22:21:11 +0200 Subject: [PATCH] Add menu --- README.md | 4 +++- iottadd.sh | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 iottadd.sh diff --git a/README.md b/README.md index 5975fb1..20e783a 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,6 @@ ## Použití -iottadd.sh < -l | -r > < id > < pass > \ No newline at end of file +iottadd.sh < -l | -r > < id > < pass > +- -l for usage on local machine +- -r for usage on server (remote) diff --git a/iottadd.sh b/iottadd.sh new file mode 100755 index 0000000..e8933f2 --- /dev/null +++ b/iottadd.sh @@ -0,0 +1,25 @@ +GREEN="\033[1;32m" +RED="\033[1;31m" +PURPLE="\033[1;35m" +BLUE="\033[1;34m" +RESET="\033[0m" + +if [[ $1 == "-l" ]]; then + # Used on local machine + echo -e $RED"Not implemented"$RESET + +elif [[ $1 == "-r" ]]; then + # Used on server + echo -en $GREEN"Running with: ID="$BLUE$2$GREEN" and PASS="$BLUE$3"\nIs that ok? ["$GREEN"Y"$BLUE"/"$RED"n"$BLUE"]"$PURPLE + read -p " " confirmation + + if [[ $confirmation == "n" ]]; then + exit 666 + fi + + +else + echo -e $RED"Expected \"-l\" or \"-r\""$RESET + +fi +