summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cmv_add.sh2
-rwxr-xr-xscripts/encode_ip.py38
-rwxr-xr-xscripts/run_server.sh1
-rwxr-xr-xscripts/run_valgrind.sh4
4 files changed, 42 insertions, 3 deletions
diff --git a/scripts/cmv_add.sh b/scripts/cmv_add.sh
index 92de535..4572b51 100755
--- a/scripts/cmv_add.sh
+++ b/scripts/cmv_add.sh
@@ -12,4 +12,4 @@ do
fi
CMD="$CMD""$EXP\n"
done
-echo -e "$CMD""X" | socat - UNIX-CONNECT:/tmp/camu_control_sock
+echo -e "$CMD""X" | socat - UNIX-CONNECT:/tmp/camu_control
diff --git a/scripts/encode_ip.py b/scripts/encode_ip.py
new file mode 100755
index 0000000..9f24fd6
--- /dev/null
+++ b/scripts/encode_ip.py
@@ -0,0 +1,38 @@
+#! /usr/bin/env python3
+
+import sys
+
+arg = sys.argv[1]
+
+# Invalid characters on Windows: \/:*?"<>|
+
+#edge_chars = ['¥','£','€','¢']
+#chars = ['¡', '"', '#', '$', '%', '&', "'", '(', ')', ',', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '—', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '}', '~']
+#chars.extend(edge_chars)
+#shift_up = '+'
+#shift_down = '-'
+#
+#c_struct = 'static char addr_char_map[] = { '
+#for i in range(0, 87):
+# c_struct += f'[\'{chars[i] if chars[i] != '\'' else '\\\''}\'] = {str(i)}'
+# if i != 86:
+# c_struct += ', '
+#c_struct += ' };'
+#
+#s = ''
+#for n in arg.split('.'):
+# i = int(n, 10)
+# if i >= 174:
+# i -= 174
+# s += shift_down
+# if i >= 87:
+# i -= 87
+# else:
+# s += shift_up
+# s += chars[i]
+
+s = ''
+for n in arg.split('.'):
+ s += '%02x' % int(n, 10)
+
+print(s)
diff --git a/scripts/run_server.sh b/scripts/run_server.sh
index 22945ed..f3c520b 100755
--- a/scripts/run_server.sh
+++ b/scripts/run_server.sh
@@ -1,5 +1,6 @@
#! /usr/bin/env sh
source ../scripts/python_env
+export CMSRV_IP=$(<../scripts/host_ip)
# screen will use $SHELL.
screen -c ../scripts/screenrc
#valgrind --leak-check=no --show-error-list=yes --log-file=./server-valgrind.log ./src/fruits/cmsrv/cmsrv $@
diff --git a/scripts/run_valgrind.sh b/scripts/run_valgrind.sh
index c49d561..7982184 100755
--- a/scripts/run_valgrind.sh
+++ b/scripts/run_valgrind.sh
@@ -1,6 +1,6 @@
#! /usr/bin/env sh
source ../scripts/python_env
#valgrind --leak-check=full --show-leak-kinds=definite ./src/fruits/cmv/cmv "$@"
-valgrind --leak-check=full --show-leak-kinds=all ./src/fruits/cmv/cmv "$@"
-#valgrind --leak-check=no --show-error-list=yes ./src/fruits/cmv/cmv "$@"
+#valgrind --leak-check=full --show-leak-kinds=all ./src/fruits/cmv/cmv "$@"
+valgrind --leak-check=no --show-error-list=yes ./src/fruits/cmv/cmv "$@"
#valgrind --tool=callgrind ./src/fruits/cmv/cmv "$@"