Bob Mottram 7 anos atrás
pai
commit
90bc724d1a
1 arquivos alterados com 7 adições e 7 exclusões
  1. 7
    7
      src/freedombone-app-peertube

+ 7
- 7
src/freedombone-app-peertube Ver arquivo

@@ -83,18 +83,18 @@ function peertube_import_from_syncthing {
83 83
       echo "peertubeuser=\$(sed -n 1p < \"\$search_dir/login.txt\")";
84 84
       echo "peertubepassword=\$(sed -n 2p < \"\$search_dir/login.txt\")";
85 85
       echo 'peertubensfw=';
86
-      echo "if grep 'nsfw' \"\$search_dir/login.txt\"; then";
86
+      echo "if grep -q 'nsfw' \"\$search_dir/login.txt\"; then";
87 87
       echo "    peertubensfw='--nsfw'";
88 88
       echo 'fi';
89
-      echo "if grep 'NSFW' \"\$search_dir/login.txt\"; then";
89
+      echo "if grep -q 'NSFW' \"\$search_dir/login.txt\"; then";
90 90
       echo "    peertubensfw='--nsfw'";
91 91
       echo 'fi';
92 92
       echo '';
93 93
       echo "peertubeprivate='-P 3'";
94
-      echo "if grep 'public' \"\$search_dir/login.txt\"; then";
94
+      echo "if grep -q 'public' \"\$search_dir/login.txt\"; then";
95 95
       echo "    peertubeprivate='-P 1'";
96 96
       echo 'fi';
97
-      echo "if grep 'Public' \"\$search_dir/login.txt\"; then";
97
+      echo "if grep -q 'Public' \"\$search_dir/login.txt\"; then";
98 98
       echo "    peertubeprivate='-P 1'";
99 99
       echo 'fi';
100 100
       echo '';
@@ -105,8 +105,8 @@ function peertube_import_from_syncthing {
105 105
       echo "    if [[ \"\$video_file\" == *'.ogv' || \"\$video_file\" == *'.mp4' || \"\$video_file\" == *'.webm' ]]; then";
106 106
       echo "        cd ${PEERTUBE_DIR} || exit 32468356";
107 107
       echo "        ";
108
-      echo "        if ! grep \"\$video_file\" /root/.peertube_uploaded; then";
109
-      echo "            if ! grep \"\$video_file\" /root/.peertube_uploading; then";
108
+      echo "        if ! grep -q \"\$video_file\" /root/.peertube_uploaded; then";
109
+      echo "            if ! grep -q \"\$video_file\" /root/.peertube_uploading; then";
110 110
       echo "                echo \"\$video_file\" >> /root/.peertube_uploading";
111 111
       echo "                peertubetitle=\$(basename \"\$video_file\" | awk -F '.' '{print \$1}' | sed 's|_| |g' | sed 's|-| |g')";
112 112
       echo "                if $nodecmd \$import_script -n \$peertubetitle \$peertubensfw \$peertubeprivate -u \"\$peertubedomain\" -U \"\$peertubeuser\" --password \"\$peertubepassword\" -f \"\$video_file\"; then";
@@ -122,7 +122,7 @@ function peertube_import_from_syncthing {
122 122
       echo '                fi';
123 123
       echo '            fi';
124 124
       echo '        else';
125
-      echo "            if grep \"\$video_file\" /root/.peertube_uploading; then";
125
+      echo "            if grep -q \"\$video_file\" /root/.peertube_uploading; then";
126 126
       echo "                sed -i \"/\$video_file/d\" /root/.peertube_uploading";
127 127
       echo '            fi';
128 128
       echo '        fi';