feat: cifs and stuff
This commit is contained in:
		
							parent
							
								
									07994c11c5
								
							
						
					
					
						commit
						4d0dcde470
					
				
					 1 changed files with 19 additions and 1 deletions
				
			
		
							
								
								
									
										20
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								setup.sh
									
										
									
									
									
								
							|  | @ -19,6 +19,8 @@ fi | ||||||
| 
 | 
 | ||||||
| ## MAIN | ## MAIN | ||||||
| 
 | 
 | ||||||
|  | set -e | ||||||
|  | 
 | ||||||
| if ! [ -f "/etc/ixvd/version" ]; then | if ! [ -f "/etc/ixvd/version" ]; then | ||||||
|     echo "applying overlay..." |     echo "applying overlay..." | ||||||
|     cp -r skel / |     cp -r skel / | ||||||
|  | @ -26,7 +28,7 @@ fi | ||||||
| 
 | 
 | ||||||
| if ! [ -d "/etc/ixvd/secrets" ]; then | if ! [ -d "/etc/ixvd/secrets" ]; then | ||||||
|     echo "setting up ixvd/secrets" |     echo "setting up ixvd/secrets" | ||||||
|     git clone git@git.ixvd.net/ixvd/secrets /etc/ixvd/secrets |     git clone git@git.ixvd.net:ixvd/secrets /etc/ixvd/secrets | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if ! [ -f "/root/.ssh/authorized_keys" ]; then | if ! [ -f "/root/.ssh/authorized_keys" ]; then | ||||||
|  | @ -39,3 +41,19 @@ else | ||||||
|         cat /etc/ixvd/secrets/ssh/authorized_keys >> /root/.ssh/authorized_keys |         cat /etc/ixvd/secrets/ssh/authorized_keys >> /root/.ssh/authorized_keys | ||||||
|     fi |     fi | ||||||
| fi | fi | ||||||
|  | 
 | ||||||
|  | if ! grep -q "# cifs mount backups" /etc/fstab; then | ||||||
|  |     echo "modifying fstab..." | ||||||
|  |     cp /etc/fstab /etc/fstab.$(date +"%H-%M-%S_%d-%m-%y").bak | ||||||
|  |     . /etc/ixvd/secrets/backups.cifs | ||||||
|  | cat<<EOF>>/etc/fstab | ||||||
|  | # cifs mount backups | ||||||
|  | //$domain/backups  /mnt/backups  cifs  credentials=/etc/ixvd/secrets/backups.cifs,file_mode=0777,dir_mode=0777,noperm 0       0 | ||||||
|  | EOF | ||||||
|  | fi | ||||||
|  | 
 | ||||||
|  | if ! [ -d "/mnt/backups" ]; then | ||||||
|  |     echo "mounting share..." | ||||||
|  |     mkdir /mnt/backups | ||||||
|  |     mount /mnt/backups | ||||||
|  | fi | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue