mirror of
				https://github.com/telekom-security/tpotce.git
				synced 2025-10-31 12:32:55 +00:00 
			
		
		
		
	fixes for update.sh
This commit is contained in:
		
							parent
							
								
									a3e0c51493
								
							
						
					
					
						commit
						1e47497c30
					
				
					 1 changed files with 16 additions and 11 deletions
				
			
		
							
								
								
									
										27
									
								
								update.sh
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								update.sh
									
									
									
									
									
								
							|  | @ -8,20 +8,25 @@ myGREEN="[0;32m" | ||||||
| myWHITE="[0;0m" | myWHITE="[0;0m" | ||||||
| myBLUE="[0;34m" | myBLUE="[0;34m" | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| # Check for existing tpot.yml | # Check for existing tpot.yml | ||||||
| function fuCONFIGCHECK () { | function fuCONFIGCHECK () { | ||||||
|   echo "### Checking for T-Pot configuration file ..." |   echo "### Checking for T-Pot configuration file ..." | ||||||
|   echo -n "###### $myBLUE$myCONFIGFILE$myWHITE " |   if ! [ -L $myCONFIGFILE ]; | ||||||
|   if ! [ -f $myCONFIGFILE ]; |  | ||||||
|     then |     then | ||||||
|       echo |       echo -n "###### $myBLUE$myCONFIGFILE$myWHITE " | ||||||
|       echo "[ $myRED""NOT OK""$myWHITE ] - No T-Pot configuration found." |       myFILE=$(head -n 1 $myCONFIGFILE | tr -d "()" | tr [:upper:] [:lower:] | awk '{ print $3 }') | ||||||
|       echo "Please create a link to your desired config i.e. 'ln -s /opt/tpot/etc/compose/standard.yml /opt/tpot/etc/tpot.yml'." |       myFILE+=".yml" | ||||||
|       echo |       echo "[ $myRED""NOT OK""$myWHITE ] - Broken symlink, trying to reset to '$myFILE'." | ||||||
|       exit 1 |       rm -rf $myCONFIGFILE | ||||||
|  |       ln -s $myCOMPOSEPATH/$myFILE $myCONFIGFILE | ||||||
|  |   fi | ||||||
|  |   if [ -L $myCONFIGFILE ]; | ||||||
|  |     then | ||||||
|  |       echo "###### $myBLUE$myCONFIGFILE$myWHITE [ $myGREEN""OK""$myWHITE ]" | ||||||
|     else |     else | ||||||
|       echo "[ $myGREEN""OK""$myWHITE ]" |       echo "[ $myRED""NOT OK""$myWHITE ] - Broken symlink and / or restore failed." | ||||||
|  |       echo "Please create a link to your desired config i.e. 'ln -s /opt/tpot/etc/compose/standard.yml /opt/tpot/etc/tpot.yml'." | ||||||
|  |       exit | ||||||
|   fi |   fi | ||||||
| echo | echo | ||||||
| } | } | ||||||
|  | @ -257,10 +262,10 @@ echo "### All objects will be overwritten upon import, make sure to run an expor | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function fuRESTORE_EWSCFG () { | function fuRESTORE_EWSCFG () { | ||||||
| if [ -f '/data/ews/conf/ews.cfg' ] && ! grep 'ews.cfg' /opt/tpot/etc/tpot.yml > /dev/null; then | if [ -f '/data/ews/conf/ews.cfg' ] && ! grep 'ews.cfg' $myCONFIGFILE > /dev/null; then | ||||||
|     echo |     echo | ||||||
|     echo "### Restoring volume mount for ews.cfg in tpot.yml" |     echo "### Restoring volume mount for ews.cfg in tpot.yml" | ||||||
|     sed -i '/\/opt\/ewsposter\/ews.ip/a\\ \ \ \ \ - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg' /opt/tpot/etc/tpot.yml |     sed -i --follow-symlinks '/\/opt\/ewsposter\/ews.ip/a\\ \ \ \ \ - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg' $myCONFIGFILE | ||||||
| fi | fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 t3chn0m4g3
						t3chn0m4g3