Code Update
This commit is contained in:
		@@ -13,7 +13,7 @@ wx-login(){
 | 
			
		||||
    elif [[ $(hostname -d) = *"devices.christerwaren.fi" ]]
 | 
			
		||||
    then
 | 
			
		||||
        ORG=cwchristerw
 | 
			
		||||
    elif [[ $USER != "root" && $USER != "local" && -f "$HOME/.warengroup/config.json" && $(cat $HOME/.warengroup/config.json | jq -r .org) ]]
 | 
			
		||||
    elif [[ $USER != "root" && $USER != "local" && -f "$HOME/.warengroup/config.json" && $(cat $HOME/.warengroup/config.json | jq -r .org) != "null" ]]
 | 
			
		||||
    then
 | 
			
		||||
        ORG=$(cat $HOME/.warengroup/config.json | jq -r .org)
 | 
			
		||||
    else
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,7 @@
 | 
			
		||||
wx-start(){
 | 
			
		||||
    wx-header "Warén CLI" h1
 | 
			
		||||
 | 
			
		||||
    if [[ $USER != "root" && $USER != "local" ]]
 | 
			
		||||
    then
 | 
			
		||||
    mkdir -p $HOME/.warengroup &> /dev/null
 | 
			
		||||
        touch $HOME/.warengroup/config.json &> /dev/null
 | 
			
		||||
 | 
			
		||||
    if [[ ! -f "$HOME/.warengroup/config.json" || $(cat $HOME/.warengroup/config.json | jq -e . >/dev/null 2>&1 | echo ${PIPESTATUS[1]}) -gt 0 ]]
 | 
			
		||||
    then
 | 
			
		||||
@@ -15,5 +12,4 @@ wx-start(){
 | 
			
		||||
    chmod 700 -R $HOME/.ssh/keys
 | 
			
		||||
    mkdir -p $HOME/.ssh/multiplex
 | 
			
		||||
    chmod 700 -R $HOME/.ssh/multiplex
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,5 +5,10 @@ wx-stop (){
 | 
			
		||||
 | 
			
		||||
    wx-install --auto
 | 
			
		||||
 | 
			
		||||
    if [[ $USERNAME != $USER && $USERNAME != $SUDO_USER && $USERNAME != $LOGNAME ]]
 | 
			
		||||
    then
 | 
			
		||||
        wx-logout
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    exit 1
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								wx
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								wx
									
									
									
									
									
								
							@@ -64,10 +64,7 @@ wx-restricted(){
 | 
			
		||||
wx-start(){
 | 
			
		||||
    wx-header "Warén CLI" h1
 | 
			
		||||
 | 
			
		||||
    if [[ $USER != "root" && $USER != "local" ]]
 | 
			
		||||
    then
 | 
			
		||||
    mkdir -p $HOME/.warengroup &> /dev/null
 | 
			
		||||
        touch $HOME/.warengroup/config.json &> /dev/null
 | 
			
		||||
 | 
			
		||||
    if [[ ! -f "$HOME/.warengroup/config.json" || $(cat $HOME/.warengroup/config.json | jq -e . >/dev/null 2>&1 | echo ${PIPESTATUS[1]}) -gt 0 ]]
 | 
			
		||||
    then
 | 
			
		||||
@@ -78,7 +75,6 @@ wx-start(){
 | 
			
		||||
    chmod 700 -R $HOME/.ssh/keys
 | 
			
		||||
    mkdir -p $HOME/.ssh/multiplex
 | 
			
		||||
    chmod 700 -R $HOME/.ssh/multiplex
 | 
			
		||||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
wx-stop (){
 | 
			
		||||
@@ -88,6 +84,11 @@ wx-stop (){
 | 
			
		||||
 | 
			
		||||
    wx-install --auto
 | 
			
		||||
 | 
			
		||||
    if [[ $USERNAME != $USER && $USERNAME != $SUDO_USER && $USERNAME != $LOGNAME ]]
 | 
			
		||||
    then
 | 
			
		||||
        wx-logout
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    exit 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -244,7 +245,7 @@ wx-login(){
 | 
			
		||||
    elif [[ $(hostname -d) = *"devices.christerwaren.fi" ]]
 | 
			
		||||
    then
 | 
			
		||||
        ORG=cwchristerw
 | 
			
		||||
    elif [[ $USER != "root" && $USER != "local" && -f "$HOME/.warengroup/config.json" && $(cat $HOME/.warengroup/config.json | jq -r .org) ]]
 | 
			
		||||
    elif [[ $USER != "root" && $USER != "local" && -f "$HOME/.warengroup/config.json" && $(cat $HOME/.warengroup/config.json | jq -r .org) != "null" ]]
 | 
			
		||||
    then
 | 
			
		||||
        ORG=$(cat $HOME/.warengroup/config.json | jq -r .org)
 | 
			
		||||
    else
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user