Check whether peertube was installed

This commit is contained in:
Bob Mottram 2017-12-04 17:09:38 +00:00
parent 0dbb10f2db
commit efc42f5447
1 changed files with 27 additions and 25 deletions

View File

@ -961,31 +961,33 @@ if [ \$no_of_users -gt 0 ]; then
fi
fi
if [ ! -f /home/$MY_USERNAME/.peertube.desktop ]; then
if [ ! -f /home/$MY_USERNAME/Desktop/peertube.desktop ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Name=PeerTube' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment=Upload and view videos on the mesh' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[el]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ar]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ca]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[hi]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[fr]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[de]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[es]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[it]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ru]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[zh]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo "Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT" >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_peertube.png" >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/peertube.desktop
chmod +x /home/$MY_USERNAME/Desktop/peertube.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/peertube.desktop
else
if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/peertube.desktop; then
sed -i "s|Exec=.*|Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT|g" /home/$MY_USERNAME/Desktop/peertube.desktop
if [ -d /etc/peertube ]; then
if [ ! -f /home/$MY_USERNAME/.peertube.desktop ]; then
if [ ! -f /home/$MY_USERNAME/Desktop/peertube.desktop ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Name=PeerTube' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment=Upload and view videos on the mesh' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[el]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ar]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ca]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[hi]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[fr]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[de]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[es]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[it]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[ru]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Comment[zh]=' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo "Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT" >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_peertube.png" >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/peertube.desktop
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/peertube.desktop
chmod +x /home/$MY_USERNAME/Desktop/peertube.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/peertube.desktop
else
if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/peertube.desktop; then
sed -i "s|Exec=.*|Exec=$BROWSER $BROWSER_OPTIONS http://\${HOSTNAME}.local:$MESH_PEERTUBE_PORT|g" /home/$MY_USERNAME/Desktop/peertube.desktop
fi
fi
fi
fi