Update 2024-12-23 14:32 OpenBSD/amd64-t14

This commit is contained in:
c0dev0id 2024-12-23 14:32:10 +01:00
parent 19fc60ef8b
commit ae5183fa58
3 changed files with 62 additions and 25 deletions

View File

@ -9,20 +9,21 @@ for arg in $@
do
# set values based of arguments found
case $arg in
s|start) shift; _start=1 ;;
k|kill|stop) shift; _stop=1 ;;
l|list) shift; _list=1 ;;
30) shift; _fps="-framerate 30" ;;
60) shift; _fps="-framerate 60" ;;
raw) shift; _format="-input_format yuyv422" ;;
fullhd) shift; _res="-video_size 1920x1080" ;;
hd) shift; _res="-video_size 1280x720" ;;
sd) shift; _res="-video_size 640x360" ;;
max) shift; _res="max" ;;
[0-9]*x[0-9]*) shift; _res="-video_size $arg" ;;
[0-9]) shift; _dev="$arg" ;;
*) shift; _unknown="$_unknown $arg" ;;
s|start) _start=1 ;;
k|kill|stop) _stop=1 ;;
l|list) _list=1 ;;
30) _fps="-framerate 30" ;;
60) _fps="-framerate 60" ;;
raw) _format="-input_format yuyv422" ;;
fullhd) _res="-video_size 1920x1080" ;;
hd) _res="-video_size 1280x720" ;;
sd) _res="-video_size 640x360" ;;
max) _res="max" ;;
[0-9]*x[0-9]*) _res="-video_size $arg" ;;
[0-9]) _dev="$arg" ;;
*) _unknown="$_unknown $arg" ;;
esac
shift;
done
if [ ! -z "$_unknown" ]

View File

@ -1,6 +1,6 @@
#!/bin/sh
case $1 in
case "$1" in
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" ;;

View File

@ -1,21 +1,57 @@
#!/bin/sh -e
if [ x"$1" == x"rm" ]
for arg in "$@"
do
case "$arg" in
sh) _ext=".sh" ;;
ksh) _ext=".ksh" ;;
txt) _ext=".txt" ;;
log) _ext=".log" ;;
rm) _rm=1 ;;
ls) _ls=1 ;;
mv) _mv=1 ;;
*) break; ;;
esac
shift;
done
if [ ! -z "$_rm" ]
then
shift
for file in $@
for file in "$@"
do
ssh sdk@codevoid.de "cd /home/www/htdocs/ptrace/paste/ && rm -v $(basename "$file")" || true
ssh sdk@codevoid.de \
"cd /home/www/htdocs/ptrace/paste/ \
&& rm -v $(basename "$file")" \
|| true
done
elif [ x"$1" == x"ls" ]
exit 0
fi
if [ ! -z "$_ls" ]
then
shift
ssh sdk@codevoid.de "cd /home/www/htdocs/ptrace/paste/ && ls -1 | xargs -n1 -I{} echo https://ptrace.org/{}"
else
for file in $@
ssh sdk@codevoid.de \
"cd /home/www/htdocs/ptrace/paste/ \
&& ls -1tr \
| xargs -n1 -I{} echo \"https://ptrace.org/{} ({})\""
exit 0
fi
if [ ! -z "$_mv" ]
then
ssh sdk@codevoid.de \
"cd /home/www/htdocs/ptrace/paste/ \
&& mv -v \"$1\" \"$2\""
exit 0
fi
if [ ! -z "$@" ]
then
for file in "$@"
do
chmod o+rw,g+r "$file"
scp "$file" sdk@codevoid.de:/home/www/htdocs/ptrace/paste/
# make sure the file is least owner rw and group r
# the sticky bit in the destiation folder will assign user+group
chmod u+rw,g+r "$file"
scp "$file" "sdk@codevoid.de:/home/www/htdocs/ptrace/paste/${file}${_ext}"
echo "https://ptrace.org/$(basename "$file")" \
| sed 's/ /%20/g' \
| xclip -f -r