From 20ae8555e3f3268054942e09462999db6b6b9145 Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Thu, 11 Sep 2025 10:14:31 +0200 Subject: [PATCH] fix(joz): Move bin files to own dir --- bin/.expect-btg-login | 11 ----------- bin/.expect-btg-pass | 12 ------------ bin/.expect-btg-test-jozagv | 14 -------------- bin/btg | 1 - bin/btg-download | 1 - bin/btg-download-database | 1 - bin/btg-download-full | 11 ----------- bin/btg-download-jozagv | 1 - bin/btg-download-logs | 2 -- bin/btg-download-map | 1 - bin/btg-download-ram | 1 - bin/btg-mount-fs | 26 -------------------------- bin/btg-ping | 1 - bin/btg-scp | 33 --------------------------------- bin/btg-test-jozagv | 2 -- bin/btg-upload-database | 1 - bin/btg-upload-jozagv | 4 ---- bin/btg-upload-jozagv-configs | 1 - bin/btg-upload-jozagv-debug | 5 ----- bin/btg-upload-jozagv-release | 4 ---- bin/btg-upload-map | 1 - bin/btg-upload-ram | 1 - bin/btg-upload-remote | 3 --- 23 files changed, 138 deletions(-) delete mode 100755 bin/.expect-btg-login delete mode 100755 bin/.expect-btg-pass delete mode 100755 bin/.expect-btg-test-jozagv delete mode 100755 bin/btg delete mode 100755 bin/btg-download delete mode 100755 bin/btg-download-database delete mode 100755 bin/btg-download-full delete mode 100755 bin/btg-download-jozagv delete mode 100755 bin/btg-download-logs delete mode 100755 bin/btg-download-map delete mode 100755 bin/btg-download-ram delete mode 100755 bin/btg-mount-fs delete mode 100755 bin/btg-ping delete mode 100755 bin/btg-scp delete mode 100755 bin/btg-test-jozagv delete mode 100755 bin/btg-upload-database delete mode 100755 bin/btg-upload-jozagv delete mode 100755 bin/btg-upload-jozagv-configs delete mode 100755 bin/btg-upload-jozagv-debug delete mode 100755 bin/btg-upload-jozagv-release delete mode 100755 bin/btg-upload-map delete mode 100755 bin/btg-upload-ram delete mode 100755 bin/btg-upload-remote diff --git a/bin/.expect-btg-login b/bin/.expect-btg-login deleted file mode 100755 index 849dc2c..0000000 --- a/bin/.expect-btg-login +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/expect -f -eval spawn $argv -set timeout -1 -match_max 100000 -expect "*?assword:*" -puts "\nAutofill password..." -send -- "$env(BTG_PASSWORD)\r" -sleep 0.3 -send -- "su\r" -send -- "cd /media/ram\r" -interact diff --git a/bin/.expect-btg-pass b/bin/.expect-btg-pass deleted file mode 100755 index 64101f8..0000000 --- a/bin/.expect-btg-pass +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/expect -f -eval spawn $argv -set timeout -1 -match_max 100000 -expect "*?assword:*" -puts "\nAutofill password..." -send -- "$env(BTG_PASSWORD)\r" -expect eof - -set return_code [wait] -exit [lindex $return_code 3] - diff --git a/bin/.expect-btg-test-jozagv b/bin/.expect-btg-test-jozagv deleted file mode 100755 index e4b215a..0000000 --- a/bin/.expect-btg-test-jozagv +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/expect -f -eval spawn $argv -set timeout -1 -match_max 100000 -expect "*?assword:*" -puts "\nAutofill password..." -send -- "$env(BTG_PASSWORD)\r" -sleep 0.3 -send -- "su\r" -send -- "/etc/init.d/crond stop\r" -send -- "/etc/init.d/jozagv stop\r" -send -- "killall -9 jozagv\r" -send -- "/media/ram/jozagv\r" -interact diff --git a/bin/btg b/bin/btg deleted file mode 100755 index 2da7e89..0000000 --- a/bin/btg +++ /dev/null @@ -1 +0,0 @@ -~/.local/bin/.expect-btg-login ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no btg@$BTG_IP diff --git a/bin/btg-download b/bin/btg-download deleted file mode 100755 index 790f8e3..0000000 --- a/bin/btg-download +++ /dev/null @@ -1 +0,0 @@ -btg-scp btg@$BTG_IP:$@ . diff --git a/bin/btg-download-database b/bin/btg-download-database deleted file mode 100755 index 5ca28bf..0000000 --- a/bin/btg-download-database +++ /dev/null @@ -1 +0,0 @@ -btg-scp btg@$BTG_IP:/usr/share/joz/jozdb.sqlite3 . diff --git a/bin/btg-download-full b/bin/btg-download-full deleted file mode 100755 index 0f8d7a0..0000000 --- a/bin/btg-download-full +++ /dev/null @@ -1,11 +0,0 @@ -out_dir=$(date +'full_%Y_%m_%d__%H_%M_%S') - -mkdir $out_dir -cd $out_dir - -# Download logs -btg-scp -r btg@$BTG_IP:/joz/agv/logs . - -btg-download-jozagv -btg-download-map -btg-download-database diff --git a/bin/btg-download-jozagv b/bin/btg-download-jozagv deleted file mode 100755 index 32f43fb..0000000 --- a/bin/btg-download-jozagv +++ /dev/null @@ -1 +0,0 @@ -btg-scp btg@$BTG_IP:/joz/agv/jozagv . diff --git a/bin/btg-download-logs b/bin/btg-download-logs deleted file mode 100755 index fdb3f08..0000000 --- a/bin/btg-download-logs +++ /dev/null @@ -1,2 +0,0 @@ -logs_dir=$(date +'logs_%Y_%m_%d__%H_%M_%S') -btg-scp -r btg@$BTG_IP:/joz/agv/logs $logs_dir diff --git a/bin/btg-download-map b/bin/btg-download-map deleted file mode 100755 index c6030fa..0000000 --- a/bin/btg-download-map +++ /dev/null @@ -1 +0,0 @@ -btg-scp btg@$BTG_IP:/etc/joz/*.xml . diff --git a/bin/btg-download-ram b/bin/btg-download-ram deleted file mode 100755 index df5dda3..0000000 --- a/bin/btg-download-ram +++ /dev/null @@ -1 +0,0 @@ -btg-download /media/ram/$@ . diff --git a/bin/btg-mount-fs b/bin/btg-mount-fs deleted file mode 100755 index 9323102..0000000 --- a/bin/btg-mount-fs +++ /dev/null @@ -1,26 +0,0 @@ -mount_folder=/mnt/btg -.enable_sshfs_user_allow_other.sh - -if [[ ! $(sudo echo 0) ]]; then exit; fi - -if mountpoint -q $mount_folder -then - echo "Mount point $mount_folder is already mounted, to unmount call 'umount $mount_folder'" - exit 0 -fi - -sudo mkdir -p $mount_folder -sudo chmod 777 $mount_folder - -#Execute the sshfs command using the expect script -sshfs -o allow_other -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o password_stdin btg@$BTG_IP:/ $mount_folder <<< $BTG_PASSWORD - -retval=$? - -# Check if retval is zero -if [ $retval -eq 0 ]; then - echo "Successfully mounted to $mount_folder" -else - echo "Error: command failed with return code $retval" - exit $retval -fi diff --git a/bin/btg-ping b/bin/btg-ping deleted file mode 100755 index f4acb38..0000000 --- a/bin/btg-ping +++ /dev/null @@ -1 +0,0 @@ -ping $BTG_IP diff --git a/bin/btg-scp b/bin/btg-scp deleted file mode 100755 index cb61169..0000000 --- a/bin/btg-scp +++ /dev/null @@ -1,33 +0,0 @@ -#Execute the scp command using the expect script -~/.local/bin/.expect-btg-pass scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $@ - -#get result -retval=$? - -# Define error code messages -case $retval in - 0) - echo "Upload/Download Successfull!" - ;; - 1) - echo "Invalid command line argument" - ;; - 2) - echo "Conflicting arguments given" - ;; - 3) - echo "General runtime error" - ;; - 4) - echo "Unrecognized response from ssh (parse error)" - ;; - 5) - echo "Invalid/incorrect password" - ;; - 6) - echo "Host public key is unknown. sshpass exits without confirming the new key." - ;; - *) - echo "Unknown error code: $retval" - ;; -esac diff --git a/bin/btg-test-jozagv b/bin/btg-test-jozagv deleted file mode 100755 index 70f447e..0000000 --- a/bin/btg-test-jozagv +++ /dev/null @@ -1,2 +0,0 @@ -btg-upload-jozagv -~/bin/.expect-btg-test-jozagv ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no btg@$BTG_IP diff --git a/bin/btg-upload-database b/bin/btg-upload-database deleted file mode 100755 index 8704079..0000000 --- a/bin/btg-upload-database +++ /dev/null @@ -1 +0,0 @@ -btg-scp $@ btg@$BTG_IP:/usr/share/joz/jozdb.sqlite3 diff --git a/bin/btg-upload-jozagv b/bin/btg-upload-jozagv deleted file mode 100755 index 986dcde..0000000 --- a/bin/btg-upload-jozagv +++ /dev/null @@ -1,4 +0,0 @@ -JOZAGV_PATH=$JOZ_PATH/jozagv/build/JOZ_Robot_Controller_SDK/MinSizeRel/jozagv - -btg-upload-jozagv-configs -btg-upload-jozagv-release diff --git a/bin/btg-upload-jozagv-configs b/bin/btg-upload-jozagv-configs deleted file mode 100755 index fce11d4..0000000 --- a/bin/btg-upload-jozagv-configs +++ /dev/null @@ -1 +0,0 @@ -btg-scp -r $JOZ_PATH/jozagv/config/* btg@$BTG_IP:/etc/joz diff --git a/bin/btg-upload-jozagv-debug b/bin/btg-upload-jozagv-debug deleted file mode 100755 index 5263abc..0000000 --- a/bin/btg-upload-jozagv-debug +++ /dev/null @@ -1,5 +0,0 @@ -JOZAGV_PATH=$JOZ_PATH/jozagv/build/JOZ_Robot_Controller_SDK/Debug/jozagv - -btg-upload-jozagv-configs -echo "Upload jozagv with modification date: $(stat -c '%y' $JOZAGV_PATH)" -btg-scp-ram $JOZAGV_PATH diff --git a/bin/btg-upload-jozagv-release b/bin/btg-upload-jozagv-release deleted file mode 100755 index 74b2786..0000000 --- a/bin/btg-upload-jozagv-release +++ /dev/null @@ -1,4 +0,0 @@ -JOZAGV_PATH=$JOZ_PATH/jozagv/build/JOZ_Robot_Controller_SDK/MinSizeRel/jozagv - -echo "Upload jozagv with modification date: $(stat -c '%y' $JOZAGV_PATH)" -btg-upload-ram $JOZAGV_PATH diff --git a/bin/btg-upload-map b/bin/btg-upload-map deleted file mode 100755 index 8b2cb29..0000000 --- a/bin/btg-upload-map +++ /dev/null @@ -1 +0,0 @@ -btg-scp $@ btg@$BTG_IP:/etc/joz/map.xml diff --git a/bin/btg-upload-ram b/bin/btg-upload-ram deleted file mode 100755 index 0d86345..0000000 --- a/bin/btg-upload-ram +++ /dev/null @@ -1 +0,0 @@ -btg-scp $@ btg@$BTG_IP:/media/ram diff --git a/bin/btg-upload-remote b/bin/btg-upload-remote deleted file mode 100755 index cddd38d..0000000 --- a/bin/btg-upload-remote +++ /dev/null @@ -1,3 +0,0 @@ -newest_build_file=$(ls -td $JOZ_PATH/remote/build/joz/*/* | head -1) -newest_build_dir=$(dirname ${newest_build_file}) -btg-scp $newest_build_dir/language.bin $newest_build_dir/version $newest_build_dir/firmware.bin btg@$BTG_IP:/etc/joz/remote/0