diff --git a/src/freedombone-app-peertube b/src/freedombone-app-peertube index 1b38aa03..0b84faec 100755 --- a/src/freedombone-app-peertube +++ b/src/freedombone-app-peertube @@ -83,18 +83,18 @@ function peertube_import_from_syncthing { echo "peertubeuser=\$(sed -n 1p < \"\$search_dir/login.txt\")"; echo "peertubepassword=\$(sed -n 2p < \"\$search_dir/login.txt\")"; echo 'peertubensfw='; - echo "if grep 'nsfw' \"\$search_dir/login.txt\"; then"; + echo "if grep -q 'nsfw' \"\$search_dir/login.txt\"; then"; echo " peertubensfw='--nsfw'"; echo 'fi'; - echo "if grep 'NSFW' \"\$search_dir/login.txt\"; then"; + echo "if grep -q 'NSFW' \"\$search_dir/login.txt\"; then"; echo " peertubensfw='--nsfw'"; echo 'fi'; echo ''; echo "peertubeprivate='-P 3'"; - echo "if grep 'public' \"\$search_dir/login.txt\"; then"; + echo "if grep -q 'public' \"\$search_dir/login.txt\"; then"; echo " peertubeprivate='-P 1'"; echo 'fi'; - echo "if grep 'Public' \"\$search_dir/login.txt\"; then"; + echo "if grep -q 'Public' \"\$search_dir/login.txt\"; then"; echo " peertubeprivate='-P 1'"; echo 'fi'; echo ''; @@ -105,8 +105,8 @@ function peertube_import_from_syncthing { echo " if [[ \"\$video_file\" == *'.ogv' || \"\$video_file\" == *'.mp4' || \"\$video_file\" == *'.webm' ]]; then"; echo " cd ${PEERTUBE_DIR} || exit 32468356"; echo " "; - echo " if ! grep \"\$video_file\" /root/.peertube_uploaded; then"; - echo " if ! grep \"\$video_file\" /root/.peertube_uploading; then"; + echo " if ! grep -q \"\$video_file\" /root/.peertube_uploaded; then"; + echo " if ! grep -q \"\$video_file\" /root/.peertube_uploading; then"; echo " echo \"\$video_file\" >> /root/.peertube_uploading"; echo " peertubetitle=\$(basename \"\$video_file\" | awk -F '.' '{print \$1}' | sed 's|_| |g' | sed 's|-| |g')"; 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 { echo ' fi'; echo ' fi'; echo ' else'; - echo " if grep \"\$video_file\" /root/.peertube_uploading; then"; + echo " if grep -q \"\$video_file\" /root/.peertube_uploading; then"; echo " sed -i \"/\$video_file/d\" /root/.peertube_uploading"; echo ' fi'; echo ' fi';