Browse Source

Check whether peertube was installed

Bob Mottram 7 years ago
parent
commit
efc42f5447
1 changed files with 27 additions and 25 deletions
  1. 27
    25
      src/freedombone-image-customise

+ 27
- 25
src/freedombone-image-customise View File

@@ -961,31 +961,33 @@ if [ \$no_of_users -gt 0 ]; then
961 961
         fi
962 962
     fi
963 963
 
964
-    if [ ! -f /home/$MY_USERNAME/.peertube.desktop ]; then
965
-        if [ ! -f /home/$MY_USERNAME/Desktop/peertube.desktop ]; then
966
-            echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/peertube.desktop
967
-            echo 'Name=PeerTube' >> /home/$MY_USERNAME/Desktop/peertube.desktop
968
-            echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/peertube.desktop
969
-            echo 'Comment=Upload and view videos on the mesh' >> /home/$MY_USERNAME/Desktop/peertube.desktop
970
-            echo 'Comment[el]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
971
-            echo 'Comment[ar]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
972
-            echo 'Comment[ca]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
973
-            echo 'Comment[hi]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
974
-            echo 'Comment[fr]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
975
-            echo 'Comment[de]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
976
-            echo 'Comment[es]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
977
-            echo 'Comment[it]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
978
-            echo 'Comment[ru]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
979
-            echo 'Comment[zh]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
980
-            echo "Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT" >> /home/$MY_USERNAME/Desktop/peertube.desktop
981
-            echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_peertube.png" >> /home/$MY_USERNAME/Desktop/peertube.desktop
982
-            echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/peertube.desktop
983
-            echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/peertube.desktop
984
-            chmod +x /home/$MY_USERNAME/Desktop/peertube.desktop
985
-            chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/peertube.desktop
986
-        else
987
-            if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/peertube.desktop; then
988
-                sed -i "s|Exec=.*|Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT|g" /home/$MY_USERNAME/Desktop/peertube.desktop
964
+    if [ -d /etc/peertube ]; then
965
+        if [ ! -f /home/$MY_USERNAME/.peertube.desktop ]; then
966
+            if [ ! -f /home/$MY_USERNAME/Desktop/peertube.desktop ]; then
967
+                echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/peertube.desktop
968
+                echo 'Name=PeerTube' >> /home/$MY_USERNAME/Desktop/peertube.desktop
969
+                echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/peertube.desktop
970
+                echo 'Comment=Upload and view videos on the mesh' >> /home/$MY_USERNAME/Desktop/peertube.desktop
971
+                echo 'Comment[el]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
972
+                echo 'Comment[ar]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
973
+                echo 'Comment[ca]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
974
+                echo 'Comment[hi]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
975
+                echo 'Comment[fr]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
976
+                echo 'Comment[de]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
977
+                echo 'Comment[es]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
978
+                echo 'Comment[it]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
979
+                echo 'Comment[ru]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
980
+                echo 'Comment[zh]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
981
+                echo "Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT" >> /home/$MY_USERNAME/Desktop/peertube.desktop
982
+                echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_peertube.png" >> /home/$MY_USERNAME/Desktop/peertube.desktop
983
+                echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/peertube.desktop
984
+                echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/peertube.desktop
985
+                chmod +x /home/$MY_USERNAME/Desktop/peertube.desktop
986
+                chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/peertube.desktop
987
+            else
988
+                if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/peertube.desktop; then
989
+                    sed -i "s|Exec=.*|Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT|g" /home/$MY_USERNAME/Desktop/peertube.desktop
990
+                fi
989 991
             fi
990 992
         fi
991 993
     fi