]> gitweb.morketsmerke.org Git - immudex-testing.git/commitdiff
Dodanie nowych wersji narzędzi 'pl' oraz 'import_gpgkeys'
authorxf0r3m <jakubstasinski@protonmail.com>
Wed, 14 Jun 2023 16:39:03 +0000 (18:39 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Wed, 14 Jun 2023 16:39:03 +0000 (18:39 +0200)
tools/100/import_gpgkeys
tools/100/pl

index dfb9ff9f3818218ed2a89ac23e8e49a58981bd6e..29f1e00823d6411d15bd729380f2520cc6c1c2b0 100755 (executable)
@@ -1,8 +1,7 @@
 #!/bin/bash
 
-if [ -f ~/public.gpg ] && [ -f ~/private.gpg ]; then
+if [ -f ~/public.gpg ] && [ -f ~/private.gpg ] && [ -f ~/otrust.txt ]; then
   gpg --import ~/public.gpg
   gpg --import ~/private.gpg
-  userId=$(gpg --list-keys | sed -nr 's/.+<(.*)>$/\1/p');
-  gpg --edit-key $userId;
+  gpg --import-ownertrust ~/otrust.txt
 fi
index efcd0b05bf0c4e0eaf24dbaf02508c3ce83ef266..34efee532e0bac11fe538a39c8e8dd3b1fbbb643 100755 (executable)
@@ -1,16 +1,29 @@
 #!/bin/bash
 
-file=$1;
+if [ "$1" ] && [ $1 = "--video" ]; then
+  video=1;
+  shift;
+  if [ $# -gt 1 ]; then format=$1; shift; file=$1;
+  else format="best"; file=$1; fi
+else
+  file=$1;
+fi
 
 function help() {
   echo "pl - Play Links. Skrypt to odtwarzania multimediów z listy linków";
   echo "morketsmerke.org; COPYLEFT; 2023";
   echo;
+  echo "Opcje:";
+  echo;
+  echo -e "\t--video [format] - możliwość odtwarzania linków jako filmów. Format";
+  echo -e "\tjest opcjonalny, w przypadku jego braku, domyślnym formatem jest";
+  echo -e "\t'best'.";
+  echo;
   echo "Użycie:";
-  echo "$ pl sciezka/do/listy/linkow";
+  echo -e "\t$ pl sciezka/do/listy/linkow";
   echo;
   echo "Format listy:";
-  echo "nazwa linku: https://youtube.com/...";
+  echo -e "\tnazwa linku: https://youtube.com/...";
 }
 
 if [ "$1" ]; then 
@@ -18,10 +31,17 @@ if [ "$1" ]; then
   linkNames=$(cut -d ":" -f 1 $1 | sed 's/\ /_/g' | awk '{printf $1" "}')
   select name in $linkNames; do
     if [ ! "$name" ]; then break; fi
-    linkName=$(echo $name | sed 's/_/\ /g');
-    link=$(grep "$linkName" $file | cut -d ":" -f 2-);
+    link=$(grep "$name" $file | cut -d ":" -f 2-);
+    if [ ! "$link" ]; then
+      linkName=$(echo $name | sed 's/_/\ /g');
+      link=$(grep "$linkName" $file | cut -d ":" -f 2-);
+    fi
     if echo $link | grep -q "youtube"; then
-      ytplay -a $link -f best[height=360];
+      if [ "$video" ]; then
+        ytplay -v $link -f $format;
+      else
+        ytplay -a $link -f best[height=360];
+      fi
     else
       mpv --no-video $link;
     fi