Last active
December 23, 2025 18:16
-
-
Save ebal/2f264c50d2210c878366d893a400541a to your computer and use it in GitHub Desktop.
Slack Installation
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 | |
| set -e # Exit on error | |
| # Create temporary directory | |
| TEMP_DIR=$(mktemp -d) | |
| echo "Created temporary directory: $TEMP_DIR" | |
| # Cleanup function to remove temp directory on exit | |
| cleanup() { | |
| echo "Cleaning up temporary directory..." | |
| rm -rf "$TEMP_DIR" | |
| } | |
| trap cleanup EXIT | |
| # Download Slack deb package | |
| echo "Downloading Slack..." | |
| SLACK_DEB="$TEMP_DIR/slack.deb" | |
| SLACK_URL=$(curl -sL "https://slack.com/downloads/instructions/linux?ddl=1&build=deb" | tr ' ' '\n' | grep -E -o -m1 'https://.*slack-desktop.*amd64.deb') | |
| curl -s -L -o "$SLACK_DEB" "$SLACK_URL" | |
| # Extract the deb package | |
| echo "Extracting Slack package..." | |
| cd "$TEMP_DIR" | |
| ar x slack.deb | |
| tar xf data.tar.xz | |
| # Create /opt/slack directory if it doesn't exist | |
| echo "Creating /opt/slack directory..." | |
| sudo mkdir -p /opt/slack | |
| # Copy files to /opt/slack | |
| echo "Copying files to /opt/slack..." | |
| sudo cp -r usr/* /opt/slack/ | |
| echo "Installation complete!" | |
| echo "Slack files have been copied to /opt/slack" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment