summarylogtreecommitdiffstats
path: root/teams-for-linux-wayland
blob: c68dcfb82ef099cc92cdfd8c1eafefd96070791a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Define the paths
TARGET_PATH="/usr/bin/teams-for-linux"
EXPECTED_LINK_TARGET="/opt/teams-for-linux/teams-for-linux"

# Check if the target path is a symlink
if [ -L "$TARGET_PATH" ] && [ "$(readlink "$TARGET_PATH")" = "$EXPECTED_LINK_TARGET" ]; then
    echo "$TARGET_PATH is a symbolic link to $EXPECTED_LINK_TARGET. Proceeding with replacement."

    # Remove the existing symlink
    rm "$TARGET_PATH"

    # Create a new script to replace the symlink
    echo "#!/bin/bash" > "$TARGET_PATH"
    echo "exec $EXPECTED_LINK_TARGET --enable-features=UseOzonePlatform --ozone-platform=wayland \"\$@\"" >> "$TARGET_PATH"

    # Make the new script executable
    chmod +x "$TARGET_PATH"
else
    echo "$TARGET_PATH is not a symbolic link to $EXPECTED_LINK_TARGET. No action taken."
fi