-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #586 from TheJumpCloud/NB-11852-desktop-app-dogfood
NB-11852: Set ReleaseChannel In JumpCloud Password Manager command
- Loading branch information
Showing
4 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...lery/Linux Commands/Linux - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Linux - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
linux | ||
|
||
#### Command | ||
|
||
``` | ||
#!/bin/bash | ||
# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
releaseChannel="public" | ||
#------- Do not modify below this line ------ | ||
allowed_values=("beta" "dogfood" "public") | ||
if [[ ! " ${allowed_values[@]} " =~ " $releaseChannel " ]]; then | ||
echo "Error: Variable \$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
fi | ||
for user in $(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd); do | ||
if [[ -d /home/$user ]]; then | ||
basePath="/home/$user/.config/JumpCloud Password Manager" | ||
filePath="$basePath/data/daemon/releaseChannel.txt" | ||
mkdir -p "$(dirname "$filePath")" | ||
echo -n "$releaseChannel" >"$filePath" | ||
sudo chown -R $user:$user "$basePath" | ||
fi | ||
done | ||
``` | ||
|
||
#### 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. | ||
|
||
#### *Import This Command* | ||
|
||
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" | ||
``` |
51 changes: 51 additions & 0 deletions
51
... Gallery/Mac Commands/Mac - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Mac - Set JumpCloud Password Manager Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
mac | ||
|
||
#### Command | ||
|
||
``` | ||
#!/bin/bash | ||
# Set releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
releaseChannel="public" | ||
#------- Do not modify below this line ------ | ||
allowed_values=("beta" "dogfood" "public") | ||
if [[ ! " ${allowed_values[@]} " =~ " $releaseChannel " ]]; then | ||
echo "Error: Variable \$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
fi | ||
for user in $(dscl . list /Users | grep -vE 'root|daemon|nobody|^_'); do | ||
if [[ -d /Users/$user ]]; then | ||
basePath="/Users/$user/Library/Application Support/JumpCloud Password Manager" | ||
filePath="$basePath/data/daemon/releaseChannel.txt" | ||
mkdir -p "$(dirname "$filePath")" | ||
echo -n "$releaseChannel" >"$filePath" | ||
sudo chown -R $user "$basePath" | ||
fi | ||
done | ||
``` | ||
|
||
#### 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. | ||
|
||
#### *Import This Command* | ||
|
||
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/Mac%20Commands/Mac%20-%20Set%20ReleaseChannel%20In%20JumpCloud%20Password%20Manager.md" | ||
``` |
51 changes: 51 additions & 0 deletions
51
.../Windows Commands/Windows - Set ReleaseChannel In JumpCloud Password Manager.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#### Name | ||
|
||
Windows - Set JumpCloud Password Manager's Release Channel | v1.0 JCCG | ||
|
||
#### commandType | ||
|
||
windows | ||
|
||
#### Command | ||
|
||
``` | ||
# Set $releaseChannel to beta OR dogfood OR public depending on your desired release channel | ||
$releaseChannel = "public" | ||
#------- Do not modify below this line ------ | ||
$allowed_values = @("beta", "dogfood", "public") | ||
if (-not ($allowed_values -ccontains $releaseChannel)) { | ||
Write-Host "Error: Variable `$releaseChannel must be either 'beta', 'dogfood', or 'public'." | ||
exit 1 | ||
} | ||
# Get the current user's SID (Security Identifier) | ||
$loggedUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName | ||
$loggedUser = $loggedUser -replace '.*\\' | ||
# Construct the Registry path using the user's SID | ||
$userSID = (New-Object System.Security.Principal.NTAccount($loggedUser)).Translate([System.Security.Principal.SecurityIdentifier]).Value | ||
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$userSID" | ||
$loggedOnUserProfileImagePath = Get-ItemPropertyValue -Path $registryPath -Name 'ProfileImagePath' | ||
$filePath = "$loggedOnUserProfileImagePath\AppData\Roaming\JumpCloud Password Manager\data\daemon\releaseChannel.txt" | ||
$directory = Split-Path $filePath | ||
if (-not (Test-Path $directory)) { | ||
New-Item -ItemType Directory -Path $directory -Force | ||
} | ||
Set-Content -Path $filePath -Value $releaseChannel -NoNewline | ||
``` | ||
|
||
#### 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. | ||
|
||
#### *Import This Command* | ||
|
||
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" | ||
``` |
This file contains 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