Skip to content

Commit

Permalink
Add script to copy the image to a txt via ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Dragon committed Oct 16, 2024
1 parent f220766 commit 06419b6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions install_ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

[[ $# == 1 ]] || { echo "$0 hostname"; exit 1; }

txt=$1

files="am335x-kno_txt.dtb uImage rootfs.img"
boot=/media/sdcard/boot

read -s -p "Password for root@$txt?" p
echo

cd output/images/

echo "Preparing"
export SSHPASS=$p
sshpass -e ssh root@$txt mkdir -p $boot/new $boot/old

echo "Copying"
sshpass -e rsync -tv --progress $files root@$txt:$boot/new

echo "Activating"
sshpass -e ssh root@$txt "cd $boot && mv $files old && mv new/* ."
echo "Success, rebooting"
sshpass -e ssh root@$txt reboot

0 comments on commit 06419b6

Please sign in to comment.