This commit is contained in:
Bob Mottram 2018-04-01 19:21:56 +01:00
parent 0ce7a79480
commit 90bc724d1a
1 changed files with 7 additions and 7 deletions

View File

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