@@ -12,9 +12,9 @@ import (
1212)
1313
1414func coreStatusCmd () (string , error ) {
15- fmt .Println ("---- VPN Status ----" )
15+ // fmt.Println("---- VPN Status ----")
1616
17- fmt .Println ("" )
17+ // fmt.Println("")
1818 activeMachineData , err := utils .GetInformationsFromActiveMachine ()
1919
2020 if err != nil {
@@ -25,18 +25,28 @@ func coreStatusCmd() (string, error) {
2525 return "" , nil
2626 }
2727
28+ if activeMachineData ["info_status" ] == nil {
29+ return "No information provided" , nil
30+ }
31+
32+ if activeMachineData ["ip" ] == nil {
33+ return "No IP assigned yet" , nil
34+ }
35+
2836 ip := activeMachineData ["ip" ].(string )
2937 name := activeMachineData ["name" ].(string )
3038 os := activeMachineData ["os" ].(string )
3139 authUserInUserOwns := activeMachineData ["authUserInUserOwns" ].(bool )
3240 authUserInRootOwns := activeMachineData ["authUserInRootOwns" ].(bool )
41+ informations := activeMachineData ["info_status" ].(string )
3342 stars := activeMachineData ["stars" ].(float64 )
3443
3544 fmt .Println ("---- Active Machine ----" )
3645 fmt .Printf ("IP : %s\n " , ip )
3746 fmt .Printf ("Name : %s\n " , name )
3847 fmt .Printf ("OS : %s\n " , os )
3948 fmt .Printf ("Stars : %v\n " , stars )
49+ fmt .Printf ("Informations : %v\n " , informations )
4050
4151 if authUserInUserOwns && authUserInRootOwns {
4252 link , err := utils .GetAchievementLink (int (activeMachineData ["id" ].(float64 )))
0 commit comments