mirror of
				https://github.com/tteck/Proxmox.git
				synced 2025-10-30 18:39:10 +00:00 
			
		
		
		
	Update build.func
Check if the shell is using bash (retry)
This commit is contained in:
		
							parent
							
								
									f3e3958299
								
							
						
					
					
						commit
						0b604d204a
					
				| @ -71,8 +71,19 @@ msg_error() { | |||||||
|   echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" |   echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | # Check if the shell is using bash | ||||||
|  | shell_check() { | ||||||
|  |   if [[ "$(basename "$SHELL")" != "bash" ]]; then | ||||||
|  |     clear | ||||||
|  |     msg_error "Your current shell is not Bash. To utilize these scripts, please switch to the Bash shell." | ||||||
|  |     echo -e "\nExiting..." | ||||||
|  |     sleep 2 | ||||||
|  |     exit | ||||||
|  |   fi | ||||||
|  | } | ||||||
|  | 
 | ||||||
| # Run as root only | # Run as root only | ||||||
| check_root() { | root_check() { | ||||||
|   if [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]]; then |   if [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]]; then | ||||||
|     clear |     clear | ||||||
|     msg_error "Please run this script as root." |     msg_error "Please run this script as root." | ||||||
| @ -450,10 +461,12 @@ advanced_settings() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| install_script() { | install_script() { | ||||||
|   check_root |  | ||||||
|   ssh_check |  | ||||||
|   arch_check |  | ||||||
|   pve_check |   pve_check | ||||||
|  |   shell_check | ||||||
|  |   root_check | ||||||
|  |   arch_check | ||||||
|  |   ssh_check | ||||||
|  | 
 | ||||||
|   if systemctl is-active -q ping-instances.service; then |   if systemctl is-active -q ping-instances.service; then | ||||||
|     systemctl -q stop ping-instances.service |     systemctl -q stop ping-instances.service | ||||||
|   fi |   fi | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user