Pārlūkot izejas kodu

Options to switch between qvitter and pleroma

Bob Mottram 8 gadus atpakaļ
vecāks
revīzija
4ca6024342

+ 7
- 3
src/freedombone-app-gnusocial Parādīt failu

315
         trap "rm -f $data" 0 1 2 5 15
315
         trap "rm -f $data" 0 1 2 5 15
316
         dialog --backtitle $"Freedombone Control Panel" \
316
         dialog --backtitle $"Freedombone Control Panel" \
317
                --title $"GNU Social" \
317
                --title $"GNU Social" \
318
-               --radiolist $"Choose an operation:" 13 70 4 \
318
+               --radiolist $"Choose an operation:" 15 70 6 \
319
                1 $"Set a background image" off \
319
                1 $"Set a background image" off \
320
                2 $"Set the title" off \
320
                2 $"Set the title" off \
321
                3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" off \
321
                3 $"Set post expiry period (currently $GNUSOCIAL_EXPIRE_MONTHS months)" off \
322
-               4 $"Exit" on 2> $data
322
+               4 $"Select Qvitter user interface" off \
323
+               5 $"Select Pleroma user interface" off \
324
+               6 $"Exit" on 2> $data
323
         sel=$?
325
         sel=$?
324
         case $sel in
326
         case $sel in
325
             1) return;;
327
             1) return;;
329
             1) gnusocial_set_background_image;;
331
             1) gnusocial_set_background_image;;
330
             2) gnusocial_set_title;;
332
             2) gnusocial_set_title;;
331
             3) gnusocial_set_expire_months;;
333
             3) gnusocial_set_expire_months;;
332
-            4) break;;
334
+            4) gnusocial_use_qvitter gnusocial;;
335
+            5) gnusocial_use_pleroma gnusocial;;
336
+            6) break;;
333
         esac
337
         esac
334
     done
338
     done
335
 }
339
 }

+ 7
- 3
src/freedombone-app-postactiv Parādīt failu

313
         trap "rm -f $data" 0 1 2 5 15
313
         trap "rm -f $data" 0 1 2 5 15
314
         dialog --backtitle $"Freedombone Control Panel" \
314
         dialog --backtitle $"Freedombone Control Panel" \
315
                --title $"PostActiv" \
315
                --title $"PostActiv" \
316
-               --radiolist $"Choose an operation:" 13 70 4 \
316
+               --radiolist $"Choose an operation:" 15 70 6 \
317
                1 $"Set a background image" off \
317
                1 $"Set a background image" off \
318
                2 $"Set the title" off \
318
                2 $"Set the title" off \
319
                3 $"Set post expiry period (currently $POSTACTIV_EXPIRE_MONTHS months)" off \
319
                3 $"Set post expiry period (currently $POSTACTIV_EXPIRE_MONTHS months)" off \
320
-               4 $"Exit" on 2> $data
320
+               4 $"Select Qvitter user interface" off \
321
+               5 $"Select Pleroma user interface" off \
322
+               6 $"Exit" on 2> $data
321
         sel=$?
323
         sel=$?
322
         case $sel in
324
         case $sel in
323
             1) return;;
325
             1) return;;
327
             1) postactiv_set_background_image;;
329
             1) postactiv_set_background_image;;
328
             2) postactiv_set_title;;
330
             2) postactiv_set_title;;
329
             3) postactiv_set_expire_months;;
331
             3) postactiv_set_expire_months;;
330
-            4) break;;
332
+            4) gnusocial_use_qvitter postactiv;;
333
+            5) gnusocial_use_pleroma postactiv;;
334
+            6) break;;
331
         esac
335
         esac
332
     done
336
     done
333
 }
337
 }

+ 36
- 0
src/freedombone-utils-gnusocialtools Parādīt failu

463
     fi
463
     fi
464
 }
464
 }
465
 
465
 
466
+function gnusocial_use_qvitter {
467
+    database_name=$1
468
+
469
+    domain_name=$(get_completion_param "$database_name domain")
470
+
471
+    if [ -f /var/www/$domain_name/htdocs/index_qvitter.php ]; then
472
+        mv /var/www/$domain_name/htdocs/index_qvitter.php /var/www/$domain_name/htdocs/index.php
473
+    fi
474
+
475
+    if [ -f /etc/nginx/sites-available/$domain_name ]; then
476
+        sed -i 's|index_qvitter.php|index.php|g' /etc/nginx/sites-available/$domain_name
477
+        sed -i 's|index.html|index.php|g' /etc/nginx/sites-available/$domain_name
478
+    fi
479
+    systemctl restart nginx
480
+}
481
+
482
+function gnusocial_use_pleroma {
483
+    database_name=$1
484
+
485
+    domain_name=$(get_completion_param "$database_name domain")
486
+
487
+    if [ ! -d /var/www/$domain_name/htdocs/static ]; then
488
+        return
489
+    fi
490
+
491
+    if [ -f /var/www/$domain_name/htdocs/index.php ]; then
492
+        mv /var/www/$domain_name/htdocs/index.php /var/www/$domain_name/htdocs/index_qvitter.php
493
+    fi
494
+
495
+    if [ -f /etc/nginx/sites-available/$domain_name ]; then
496
+        sed -i 's|index.php|index_qvitter.php|g' /etc/nginx/sites-available/$domain_name
497
+        sed -i 's|index index_qvitter.php|index index.html|g' /etc/nginx/sites-available/$domain_name
498
+    fi
499
+    systemctl restart nginx
500
+}
501
+
466
 # NOTE: deliberately there is no "exit 0"
502
 # NOTE: deliberately there is no "exit 0"