splitting some stuff for later
This commit is contained in:
		
							parent
							
								
									e2a1d5fa18
								
							
						
					
					
						commit
						0c9ea26155
					
				
					 9 changed files with 67 additions and 30 deletions
				
			
		|  | @ -35,28 +35,4 @@ elif chroot /mnt /bin/bash -c "command -v grub-install &>/dev/null;" then | |||
|     chroot /mnt /bin/bash -c "grub-install /dev/sda" | ||||
| fi | ||||
| 
 | ||||
| while true; do | ||||
|     read -p "Enter a username (lowercase letters, digits, underscores and hyphens): " username | ||||
|     chroot /mnt /bin/bash -c "useradd -m '$username'" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| while true; do | ||||
|     chroot /mnt /bin/bash -c "passwd '$username'" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| while true; do | ||||
|     read -p "Enter the hostname: " hostname | ||||
|     chroot /mnt /bin/bash -c "echo $hostname > /etc/hostname" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
|  |  | |||
							
								
								
									
										23
									
								
								configs/scripts/server.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								configs/scripts/server.sh
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| #!/bin/bash | ||||
| 
 | ||||
| # This file is part of VM-Experiments. | ||||
| # Licensed under the GPL-3.0-or-later. See LICENSE for details. | ||||
| 
 | ||||
| trap '' SIGINT SIGTERM | ||||
| 
 | ||||
| while true; do | ||||
|     chroot /mnt /bin/bash -c "passwd root" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| while true; do | ||||
|     read -p "Enter the hostname: " hostname | ||||
|     chroot /mnt /bin/bash -c "echo $hostname > /etc/hostname" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
							
								
								
									
										32
									
								
								configs/scripts/user.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								configs/scripts/user.sh
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,32 @@ | |||
| #!/bin/bash | ||||
| 
 | ||||
| # This file is part of VM-Experiments. | ||||
| # Licensed under the GPL-3.0-or-later. See LICENSE for details. | ||||
| 
 | ||||
| trap '' SIGINT SIGTERM | ||||
| 
 | ||||
| while true; do | ||||
|     read -p "Enter a username (lowercase letters, digits, underscores and hyphens): " username | ||||
|     chroot /mnt /bin/bash -c "useradd -m '$username'" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| while true; do | ||||
|     chroot /mnt /bin/bash -c "passwd '$username'" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
| 
 | ||||
| while true; do | ||||
|     read -p "Enter the hostname: " hostname | ||||
|     chroot /mnt /bin/bash -c "echo $hostname > /etc/hostname" | ||||
| 
 | ||||
|     if [ $? -eq 0 ]; then | ||||
|         break | ||||
|     fi | ||||
| done | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Patrick_Pluto
						Patrick_Pluto