You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					37 lines
				
				1.0 KiB
			
		
		
			
		
	
	
					37 lines
				
				1.0 KiB
			| 
											2 years ago
										 | #!/bin/bash | ||
|  | # info: Restore system configuration | ||
|  | # options: [SYSTEM] | ||
|  | # | ||
|  | # example: v-repair-sys-config | ||
|  | # | ||
|  | # This function repairs or restores the system configuration file. | ||
|  | 
 | ||
|  | mode=$1 | ||
|  | 
 | ||
|  | # Includes | ||
|  | # shellcheck source=/etc/hestiacp/hestia.conf | ||
|  | source /etc/hestiacp/hestia.conf | ||
|  | # shellcheck source=/usr/local/hestia/func/main.sh | ||
|  | source $HESTIA/func/main.sh | ||
|  | 
 | ||
|  | #----------------------------------------------------------# | ||
|  | #                        Action                            # | ||
|  | #----------------------------------------------------------# | ||
|  | 
 | ||
|  | if [ "$mode" = "restore" ]; then | ||
|  | 	syshealth_restore_system_config | ||
|  | fi | ||
|  | 
 | ||
|  | if [ "$mode" = "repair" ]; then | ||
|  | 	# load config file | ||
|  | 	source_conf "$HESTIA/conf/hestia.conf" | ||
|  | 	syshealth_repair_system_config | ||
|  | fi | ||
|  | 
 | ||
|  | #----------------------------------------------------------# | ||
|  | #                        Hestia                            # | ||
|  | #----------------------------------------------------------# | ||
|  | 
 | ||
|  | $BIN/v-log-action "system" "Info" "System" "Executed $mode operation on system configuration." | ||
|  | log_event "$OK" "$ARGUMENTS" |