From 4be1aafda6e886ba7e6c05e2567cd949d2b6a47a Mon Sep 17 00:00:00 2001 From: Gianni Bitar Date: Thu, 4 Jul 2024 11:40:43 +0300 Subject: [PATCH] fix: Mac - Set ReleaseChannel In JumpCloud Password Manager.md loops over users --- ...aseChannel In JumpCloud Password Manager.md | 18 ++++++++++++++---- .../JumpCloud Commands Gallery/commands.json | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/PowerShell/JumpCloud Commands Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md b/PowerShell/JumpCloud Commands Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md index 7342d9cab..05e271d3f 100644 --- a/PowerShell/JumpCloud Commands Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md +++ b/PowerShell/JumpCloud Commands Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md @@ -11,14 +11,24 @@ mac ``` #!/bin/bash -# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 4 depending on your desired release channel +# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 15 depending on your desired release channel RELEASE_CHANNEL="public" #------- Do not modify below this line ------ -FILE_PATH="$HOME/Library/Application Support/JumpCloud Password Manager/data/daemon/releaseChannel.txt" -mkdir -p "$(dirname "$FILE_PATH")" -echo -n "$RELEASE_CHANNEL" > "$FILE_PATH" +for user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do + if [[ -d /Users/$user ]]; then + BASE_PATH="/Users/$user/Library/Application Support/JumpCloud Password Manager" + + FILE_PATH="$BASE_PATH/data/daemon/releaseChannel.txt" + + mkdir -p "$(dirname "$FILE_PATH")" + + echo -n "$RELEASE_CHANNEL" >"$FILE_PATH" + + sudo chown -R $user "$BASE_PATH" + fi +done ``` #### Description diff --git a/PowerShell/JumpCloud Commands Gallery/commands.json b/PowerShell/JumpCloud Commands Gallery/commands.json index 838885b1f..617debc60 100644 --- a/PowerShell/JumpCloud Commands Gallery/commands.json +++ b/PowerShell/JumpCloud Commands Gallery/commands.json @@ -233,7 +233,7 @@ { "name": "Mac - Set JumpCloud Password Manager Release Channel | v1.0 JCCG", "type": "mac", - "command": "#!/bin/bash\n\n# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 4 depending on your desired release channel\nRELEASE_CHANNEL=\"public\"\n\n#------- Do not modify below this line ------\n\nFILE_PATH=\"$HOME/Library/Application Support/JumpCloud Password Manager/data/daemon/releaseChannel.txt\"\nmkdir -p \"$(dirname \"$FILE_PATH\")\"\necho -n \"$RELEASE_CHANNEL\" > \"$FILE_PATH\"", + "command": "#!/bin/bash\n\n# Set $RELEASE_CHANNEL to beta OR dogfood OR public ON LINE 15 depending on your desired release channel\nRELEASE_CHANNEL=\"public\"\n\n#------- Do not modify below this line ------\n\nfor user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do\n if [[ -d /Users/$user ]]; then\n BASE_PATH=\"/Users/$user/Library/Application Support/JumpCloud Password Manager\"\n\n FILE_PATH=\"$BASE_PATH/data/daemon/releaseChannel.txt\"\n\n mkdir -p \"$(dirname \"$FILE_PATH\")\"\n\n echo -n \"$RELEASE_CHANNEL\" >\"$FILE_PATH\"\n\n sudo chown -R $user \"$BASE_PATH\"\n fi\ndone", "link": "https://github.com/TheJumpCloud/support/blob/master/PowerShell/JumpCloud%20Commands%20Gallery/Mac%20Commands/Mac%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." },