Skip to content

Commit

Permalink
chore: add Linux - Set ReleaseChannel In JumpCloud Password Manager.m…
Browse files Browse the repository at this point in the history
…d into commnands.json
  • Loading branch information
gbitarjc committed Jun 21, 2024
1 parent f882502 commit 4c65079
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ This command will set the desired release channel for JumpCloud's Password Manag

To import this command into your JumpCloud tenant run the below command using the [JumpCloud PowerShell Module](https://github.com/TheJumpCloud/support/wiki/Installing-the-JumpCloud-PowerShell-Module)

```
Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md"
```
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ This command will set the desired release channel for JumpCloud's Password Manag

To import this command into your JumpCloud tenant run the below command using the [JumpCloud PowerShell Module](https://github.com/TheJumpCloud/support/wiki/Installing-the-JumpCloud-PowerShell-Module)

```
Import-JCCommand -URL "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Windows%20Commands/Windows%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md"
```
9 changes: 8 additions & 1 deletion PowerShell/JumpCloud Commands Gallery/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@
{
"name": "Linux - remote-assist - Enable wayland windowing system | v1.0 JCCG",
"type": "linux",
"command": "#!/bin/bash\n################################################################################\n# This script will enable wayland windowing system\n################################################################################\n\nif [[ \"${UID}\" != 0 ]]; then\n (>&2 echo \"Error: $0 must be run as root\")\n exit 1\nfi\n\nenable_wayland() {\n case ${linuxType} in\n ubuntu|\\\"rocky\\\"|\\\"centos\\\")\n `sed -i 's/WaylandEnable=.*/#WaylandEnable=false/' /etc/gdm3/custom.conf`\n ;;\n debian)\n `sed -i 's/WaylandEnable=.*/#WaylandEnable=false/' /etc/gdm3/daemon.conf`\n ;;\n esac\n}\n\n# Get the current windowing system\nwindowingSystem=$(echo $XDG_SESSION_TYPE)\nif [[ \"$windowingSystem\" == \"\" ]]; then\n windowingSystem=`loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'`\nfi\n\n# Get the linux type\nlinuxType=`awk -F= '$1==\"ID\" { print $2 ;}' /etc/os-release`\nlinuxType=\"$(echo -e \"${linuxType}\" | sed -e 's/^[[:space:]]*//')\"\n\nif [[ \"$linuxType\" == \"linuxmint\" ]]; then\n echo \"Linuxmint does not support wayland. Nothing to be done for linuxmint.\"\n exit 0\nfi\n\nif [[ \"$windowingSystem\" == \"wayland\" ]]; then\n echo \"Windowing System is already set to wayland\"\n exit 1\nelif [[ \"$windowingSystem\" == \"x11\" ]]; then\n enable_wayland \"$linuxType\"\nfi\n\necho \"Next step is to either 'reboot' the machine or run 'sudo systemctl restart gdm'.\"\n\nexit 0",
"command": "#!/bin/bash # Set $RELEASE_CHANNEL to beta OR dogfood OR public depending on your desired releaseChannel RELEASE_CHANNEL="public" # Set $TARGET_ENVIRONMENT to production OR staging OR local to target user's environment TARGET_ENVIRONMENT="production" #------- Do not modify below this line ------ APP_NAME="JumpCloud Password Manager" # Function to set application's name based on environment detect_env() { case "$TARGET_ENVIRONMENT" in "production") APP_NAME="JumpCloud Password Manager" ;; "staging") APP_NAME="JC Password Manager Staging" ;; "local") APP_NAME="JC Password Manager Local" ;; *) APP_NAME="JumpCloud Password Manager" ;; esac } # Function to update or create file with content update_file() { FILE_PATH="$HOME/.config/$APP_NAME/data/daemon/releaseChannel.txt" mkdir -p "$(dirname "$FILE_PATH")" echo -n "$RELEASE_CHANNEL" > "$FILE_PATH" } main() { detect_env update_file } main",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20remote-assist%20-%20Enable%20wayland%20windowing%20system.md",
"description": "This script enables the Wayland windowing system on the Linux machine."
},
{
"name": "Linux - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG",
"type": "linux",
"command": "#!/bin/bash\n################################################################################\n# This script will enable wayland windowing system\n################################################################################\n\nif [[ \"${UID}\" != 0 ]]; then\n (>&2 echo \"Error: $0 must be run as root\")\n exit 1\nfi\n\nenable_wayland() {\n case ${linuxType} in\n ubuntu|\\\"rocky\\\"|\\\"centos\\\")\n `sed -i 's/WaylandEnable=.*/#WaylandEnable=false/' /etc/gdm3/custom.conf`\n ;;\n debian)\n `sed -i 's/WaylandEnable=.*/#WaylandEnable=false/' /etc/gdm3/daemon.conf`\n ;;\n esac\n}\n\n# Get the current windowing system\nwindowingSystem=$(echo $XDG_SESSION_TYPE)\nif [[ \"$windowingSystem\" == \"\" ]]; then\n windowingSystem=`loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'`\nfi\n\n# Get the linux type\nlinuxType=`awk -F= '$1==\"ID\" { print $2 ;}' /etc/os-release`\nlinuxType=\"$(echo -e \"${linuxType}\" | sed -e 's/^[[:space:]]*//')\"\n\nif [[ \"$linuxType\" == \"linuxmint\" ]]; then\n echo \"Linuxmint does not support wayland. Nothing to be done for linuxmint.\"\n exit 0\nfi\n\nif [[ \"$windowingSystem\" == \"wayland\" ]]; then\n echo \"Windowing System is already set to wayland\"\n exit 1\nelif [[ \"$windowingSystem\" == \"x11\" ]]; then\n enable_wayland \"$linuxType\"\nfi\n\necho \"Next step is to either 'reboot' the machine or run 'sudo systemctl restart gdm'.\"\n\nexit 0",
"link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Linux%20Commands/Linux%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md",
"description": "This command will set the desired release channel for JumpCloud's Password Manager in application's directory. The relesase channel options are beta, dogfood and public."
},
{
"name": "Mac - Disable Local User | v1.0 JCCG",
"type": "mac",
Expand Down

0 comments on commit 4c65079

Please sign in to comment.