2024-12-22 19:14:43 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
case $1 in
|
2024-12-23 02:01:54 +01:00
|
|
|
put|push) shift; rsync -rv --progress --append-verify $@ osmc:/media/USBDisk/ ;;
|
|
|
|
df) shift; ssh osmc "df -h /media/USBDisk/" ;;
|
|
|
|
ls) shift; ssh osmc "cd /media/USBDisk/ && ls $@ | grep -v lost+found" ;;
|
|
|
|
lls) shift; ssh osmc "cd /media/USBDisk/ && ls -lh | grep -v lost+found" ;;
|
|
|
|
del) shift; ssh osmc "cd /media/USBDisk/ && rm -v $@" ;;
|
|
|
|
ren) shift; ssh osmc "cd /media/USBDisk/ && mv \"$1\" \"$2\"" ;;
|
|
|
|
at) shift; ssh -tt osmc "tmux at" ;;
|
|
|
|
*) echo "usage: osmc <command> <args>"
|
|
|
|
echo " df - show disk space allocation"
|
|
|
|
echo " ls - list files"
|
|
|
|
echo " lls - list files with details"
|
|
|
|
echo " put <files> - copy files to USBDisk"
|
|
|
|
echo " ren <old> <new> - rename file"
|
|
|
|
echo " del <files> - delete file"
|
|
|
|
echo " at - attach to tmux session"
|
|
|
|
exit 2
|
|
|
|
;;
|
2024-12-22 19:14:43 +01:00
|
|
|
esac
|