This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Discord App auto-updater for Debian | |
| # | |
| # This script is responsible for managing the Discord application on a system. | |
| # It performs the following tasks: | |
| # 1. Checks if Discord is currently installed on the system. | |
| # 2. If Discord is not installed, the script downloads and installs the latest version. | |
| # 3. If Discord is already installed, the script checks for the latest version online. | |
| # 4. If a newer version of Discord is available, the script downloads and updates Discord to the latest version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function shuffle(array) { | |
| let currentIndex = array.length, randomIndex; | |
| // While there remain elements to shuffle. | |
| while (currentIndex != 0) { | |
| // Pick a remaining element. | |
| randomIndex = Math.floor(Math.random() * currentIndex); | |
| currentIndex--; | |