v0.1
This commit is contained in:
		
							
								
								
									
										34
									
								
								scpt/env
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								scpt/env
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
cfg=~/.config/ai/test.json
 | 
			
		||||
 | 
			
		||||
if [ ! -f $cfg ] || ! cat $cfg|jq . || [ "`cat $cfg|jq .host`" = "null" ] || [ -z "`cat $cfg`" ];then
 | 
			
		||||
	mkdir -p ~/.config/ai
 | 
			
		||||
	echo server:
 | 
			
		||||
	read host
 | 
			
		||||
 | 
			
		||||
	echo password:
 | 
			
		||||
	read pass
 | 
			
		||||
 | 
			
		||||
	echo handle:
 | 
			
		||||
	read handle
 | 
			
		||||
 | 
			
		||||
	echo "{ \"host\":\"$host\", \"password\":\"$pass\", \"handle\":\"$handle\" }" >> $cfg
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
host=`cat $cfg|jq -r .host`
 | 
			
		||||
handle=`cat $cfg|jq -r .handle`
 | 
			
		||||
pass=`cat $cfg|jq -r .password`
 | 
			
		||||
date=`date --iso-8601=seconds`
 | 
			
		||||
 | 
			
		||||
if [ ! -f $cfg.t ];then
 | 
			
		||||
	$d/token.zsh
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ -f $cfg.t ];then
 | 
			
		||||
	token=`cat $cfg.t|jq -r .accessJwt`
 | 
			
		||||
	refresh=`cat $cfg.t|jq -r .refreshJwt`
 | 
			
		||||
	did=`cat $cfg.t|jq -r .did`
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ ! -d $d/json ];then
 | 
			
		||||
	mkdir -p $d/json
 | 
			
		||||
fi
 | 
			
		||||
		Reference in New Issue
	
	Block a user