Bläddra i källkod

Initial Commit

mike 1 månad sedan
incheckning
d034a5faa4
6 ändrade filer med 142 tillägg och 0 borttagningar
  1. 1 0
      .gitignore
  2. BIN
      Nextcloud.png
  3. BIN
      assets/Nextcloud.png
  4. 17 0
      assets/nextcloud.desktop
  5. 107 0
      install.sh
  6. 17 0
      nextcloud.desktop

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+apps/

BIN
Nextcloud.png


BIN
assets/Nextcloud.png


+ 17 - 0
assets/nextcloud.desktop

@@ -0,0 +1,17 @@
+[Desktop Entry]
+Version=1.0
+#NoDisplay=true
+Name=Nextcloud Desktop Client
+GenericName=Nextcloud
+#Keywords=Internet;WWW;Browser;Web;Explorer
+Exec=nextcloud &
+Terminal=false
+#X-MultipleArgs=false
+Type=Application
+Icon=/home/mike/Software/Nextcloud/Nextcloud.png
+#Categories=GNOME;GTK;Network;WebBrowser;
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;video/webm;application/x-xpinstall;
+#StartupNotify=true
+#StartupWMClass=firefox
+#Actions=new-window;new-private-window;
+

+ 107 - 0
install.sh

@@ -0,0 +1,107 @@
+#! /bin/bash
+
+# - Take new tar file as argument		DONE
+# - Verify argument is valid			DONE
+# - Verify script is running as sudo		DONE
+# - Move existing firefox to firefox.OLD	DONE
+# - create directory for new installation	DONE
+# - unpack tar file to new location		DONE
+# - Optional, verify desktop file extsts
+
+
+helpFunction()
+{
+  echo " "
+  echo "Provides convenient means to install a new Nextcloud AppImage file."
+  echo "Pass new AppImage file as argument and this script will update the symlinks and verify installation."
+  echo "Must run with root privileges."
+  echo " "
+  echo "Usage: sudo $0 [filename]"
+  echo " "
+}
+
+
+
+
+## Take input and verify file and root user##
+
+filename=$(basename $1)  ##Take Basename in case file in cae user is in unusual directory when calling script.
+projectdir="/home/mike/Software/Nextcloud"
+imagepath="$projectdir/apps"
+executablelink="/usr/local/bin"
+desktoppath="/usr/local/share/applications"
+assetspath="$projectdir/assets"
+version="0.1"
+
+# Start Script #
+
+echo "Nextcloud Client Update Script v$version"
+
+
+# Check Arguments #
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+  helpFunction
+  exit 0
+fi
+
+  # Check if user-provided file is valid #
+
+if ! [ -f "$1" ]; then
+  echo "$1 not found."
+  helpFunction
+  exit 1
+elif ! [ -f "$imagepath/$filename" ]; then
+  echo "Moving $1 to $imagepath/"
+  mv $1 $imagepath/
+  echo "Done."
+fi
+
+if [ -z "$filename" ]
+then
+  echo " "
+  echo "No filename given.  Aborting."
+  helpFunction
+  exit 1
+fi
+
+if [ "$USER" != "root" ]; then
+  echo "Must be running as root to install new software.  Use sudo or root user"
+  helpFunction
+  exit 1
+fi
+
+# Argument and file checking complete...#
+
+echo "Updating Nextcloud client..."
+
+
+# Ensure AppImage is Executable
+
+echo "Setting $filename as executable"
+sudo chmod +x $imagepath/$filename
+echo "Done."
+
+
+# Ensure symlink is set
+
+echo "Setting symlink /usr/local/bin/nextcloud/"
+ln -fs $imagepath/$filename $executablelink/nextcloud
+echo "Done."
+
+
+# Ensure Desktop file is set
+
+if ! [ -f "$projectdir/nextcloud.desktop" ]; then
+  echo "WARNING: nextcloud.desktop file not found!"
+  echo "WARNING: Desktop file not set!"
+  exit 1
+fi
+
+echo "Setting nextcloud.desktop in /usr/local/share/applications and verifying permissions"
+ln -fs $projectdir/nextcloud.desktop $desktoppath/
+chmod +x $projectdir/nextcloud.desktop
+echo "Done."
+
+echo "Update Complete.  Done."
+exit 0

+ 17 - 0
nextcloud.desktop

@@ -0,0 +1,17 @@
+[Desktop Entry]
+Version=1.0
+#NoDisplay=true
+Name=Nextcloud Desktop Client
+GenericName=Nextcloud
+#Keywords=Internet;WWW;Browser;Web;Explorer
+Exec=nextcloud &
+Terminal=false
+#X-MultipleArgs=false
+Type=Application
+Icon=/home/mike/Software/Nextcloud/Nextcloud.png
+#Categories=GNOME;GTK;Network;WebBrowser;
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;video/webm;application/x-xpinstall;
+#StartupNotify=true
+#StartupWMClass=firefox
+#Actions=new-window;new-private-window;
+