Bläddra i källkod

Original commit. Pre install script.

mike 1 månad sedan
incheckning
24a69e6b09
7 ändrade filer med 337 tillägg och 0 borttagningar
  1. BIN
      assets/firefox-144.0.2.tar.xz
  2. BIN
      assets/firefox-144.0.tar.xz
  3. 17 0
      firefox.desktop
  4. 11 0
      howto.txt
  5. 117 0
      install.sh
  6. 107 0
      install.sh.NEXTCLOUD
  7. 85 0
      install.sh.OLD

BIN
assets/firefox-144.0.2.tar.xz


BIN
assets/firefox-144.0.tar.xz


+ 17 - 0
firefox.desktop

@@ -0,0 +1,17 @@
+[Desktop Entry]
+Version=1.0
+#NoDisplay=true
+Name=Firefox Web Browser
+GenericName=Web Browser
+Keywords=Internet;WWW;Browser;Web;Explorer
+Exec=firefox %u
+Terminal=false
+#X-MultipleArgs=false
+Type=Application
+Icon=/opt/firefox/browser/chrome/icons/default/default128.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;
+

+ 11 - 0
howto.txt

@@ -0,0 +1,11 @@
+sudo snap remove firefox
+sudo tar xjvf ~/Downloads/firefox-*.tar.bz2 -C /opt/
+sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox
+udo wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications
+
+-----
+Don't forget to move personal profile files to new instance too.
+
+
+----
+To update, download the new version and install

+ 117 - 0
install.sh

@@ -0,0 +1,117 @@
+#! /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 Firefox tar file."
+  echo "Pass new tar file as argument and this script will handle backing up the current installation and unpacking the new installation."
+  echo "This script will prompt before deleting a previous archive."
+  echo "Must run with root privileges."
+  echo " "
+  echo "Usage: $0 [filename]"
+  echo " "
+}
+
+
+
+
+## Take input and verify file and root user##
+
+filename=$1
+
+if [ "$filename" = "-h" ] || [ "$filename" = "--help" ]; then
+  helpFunction
+  exit 0
+fi
+
+if ! [ -f "$filename" ]; then
+  echo "$1 not found."
+  helpFunction
+  exit 1
+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
+
+echo "$1 file found"
+
+
+## Move existing folder to .OLD and delete existing .OLD if needed ##
+
+echo "Checking for old installations"
+
+if [ -d "/opt/firefox.OLD" ]; then
+  read -p  "firefox.OLD already exists?  Should I delete it? ENTER to continue or CTRL+C to abort." input
+fi
+
+echo "Deleting existing firefox.OLD folder"
+
+rm -rf /opt/firefox.OLD
+
+echo "Moving Existing firefox to firefox.OLD"
+
+mv /opt/firefox /opt/firefox.OLD
+
+echo "Making new firefox directory"
+
+mkdir /opt/firefox
+
+echo "unpacking "$filename" to /opt/firefox"
+
+## Check file type and unpack accordingly ##
+
+if [[ "$filename" == *.tar.xz ]]; then
+  echo "Unpacking as tar.xf file" 
+  tar -xvf "$filename" -C "/opt/"
+elif [[ "$filename" == *.tar.bz2 ]]; then
+  echo "Unpacking as tar.bz2 file"
+  tar -xjvf "$filename" -C "/opt/"
+else
+  echo "WARNING: Unknown Compression Type.  Aborting."
+  exit 1
+fi
+
+
+# ensure symlink is set
+
+ln -fs /opt/firefox/firefox /usr/local/bin/firefox
+echo "Symlink /usr/local/bin/firefox set."
+
+# ensure /opt permissions are set correctly
+
+chown mike:mike /opt/firefox
+echo "/opt/firefox permissions set"
+
+# ensure .desktop file is set
+
+if [ -f "firefox.desktop" ]; then
+  echo "Setting .desktop file."
+  ln -fs /home/mike/Software/firefox/firefox.desktop /usr/local/share/applications
+  echo "Done."
+else
+  echo ""
+  echo "WARNING: firefox.desktop not found.  Could not install desktop file."
+  echo "Check for existence of firefox.desktop file in this folder."
+  exit 1
+fi
+

+ 107 - 0
install.sh.NEXTCLOUD

@@ -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.2"
+
+# 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 "$assetspath/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 $assetspath/nextcloud.desktop $desktoppath/
+chmod +x $assetspath/nextcloud.desktop
+echo "Done."
+
+echo "Update Complete.  Done."
+exit 0

+ 85 - 0
install.sh.OLD

@@ -0,0 +1,85 @@
+#! /bin/sh
+
+# - 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 Firefox tar file."
+  echo "Pass new tar file as argument and this script will handle backing up the current installation and unpacking the new installation."
+  echo "This script will prompt before deleting a previous archive."
+  echo "Must run with root privileges."
+  echo " "
+  echo "Usage: $0 [filename]"
+  echo " "
+}
+
+
+
+
+## Take input and verify file and root user##
+
+filename=$1
+
+if [ "$filename" = "-h" ] || [ "$filename" = "--help" ]; then
+  helpFunction
+  exit 0
+fi
+
+if ! [ -f "$filename" ]; then
+  echo "$1 not found."
+  helpFunction
+  exit 1
+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
+
+echo "$1 file found"
+
+
+## Move existing folder to .OLD and delete existing .OLD if needed ##
+
+echo "Checking for old installations"
+
+if [ -d "/opt/firefox.OLD" ]; then
+  read -p  "firefox.OLD already exists?  Should I delete it? ENTER to continue or CTRL+C to abort." input
+fi
+
+echo "Deleting existing firefox.OLD folder"
+
+rm -rf /opt/firefox.OLD
+
+echo "Moving Existing firefox to firefox.OLD"
+
+mv /opt/firefox /opt/firefox.OLD
+
+echo "Making new firefox directory"
+
+mkdir /opt/firefox
+
+echo "unpacking "$filename" to /opt/firefox"
+
+tar -xjvf "$filename" -C "/opt/"
+
+# ensure symlink is set
+
+ln -fs /opt/firefox/firefox /usr/local/bin/firefox