Begin work on config tool
This commit is contained in:
		
							parent
							
								
									2ae4d264f0
								
							
						
					
					
						commit
						890c66cba0
					
				| @ -28,9 +28,11 @@ AUTOCONFIG_BIN="iptables:IPTABLES ip6tables:IP6TABLES modprobe:MODPROBE" | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # These are string variables | # These are string variables | ||||||
| WELCOME_HEAD="Welcome to the Firewall/SOSDG Config Tool v${CONFIGTOOL_VER}" | TOOL_TITLE="Welcome to the Firewall/SOSDG Config Tool v${CONFIGTOOL_VER}" | ||||||
| WELCOME_BODY="This tool is a quick way to do a basic setup of the firewall script.\n\nThe results of this tool will be output to a file of your choosing at the end of configuration.\nContinue?" | WELCOME_BODY="This tool is a quick way to do a basic setup of the firewall script.\n\nThe results of this tool will be output to a file of your choosing at the end of configuration.\nContinue?" | ||||||
| AUTOCONFIG_PATHS="Would you like to try to configure paths of important programs automatically?" | AUTOCONFIG_PATHS="Would you like to try to configure paths of important programs automatically?" | ||||||
|  | FAILED_BINS="The following binaries were not found on this system:" | ||||||
|  | FAILED_BINS_FOOT="Please edit the config file by hand and put in the proper path." | ||||||
| 
 | 
 | ||||||
| if [ ! -x $WHIPTAIL ]; then | if [ ! -x $WHIPTAIL ]; then | ||||||
| 	echo "Error: please make sure you have whiptail installed, and the WHIPTAIL variable  | 	echo "Error: please make sure you have whiptail installed, and the WHIPTAIL variable  | ||||||
| @ -39,7 +41,7 @@ if [ ! -x $WHIPTAIL ]; then | |||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if ! ( $WHIPTAIL --yesno "${WELCOME_HEAD}\n${WELCOME_BODY}" 12 70 --no-button "Quit" ); then | if ! ( $WHIPTAIL --title "${TOOL_TITLE}" --yesno "${WELCOME_BODY}" 12 70 --no-button "Quit" ); then | ||||||
| 	echo "Quitting config tool." | 	echo "Quitting config tool." | ||||||
| 	rm -f "$TMPCONFIG" | 	rm -f "$TMPCONFIG" | ||||||
| 	exit 1 | 	exit 1 | ||||||
| @ -52,16 +54,23 @@ else | |||||||
| 	exit 1 | 	exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| if ( $WHIPTAIL --yesno "${AUTOCONFIG_PATHS}" 10 40 ); then | if ( $WHIPTAIL --title "${TOOL_TITLE}" --yesno "${AUTOCONFIG_PATHS}" 10 40 ); then | ||||||
|  | 	unset FAILED_CMD_PATH | ||||||
| 	for i in $AUTOCONFIG_BIN; do | 	for i in $AUTOCONFIG_BIN; do | ||||||
| 		IFS_OLD=${IFS};IFS=: | 		IFS_OLD=${IFS};IFS=: | ||||||
| 		BIN_PATH=($i) | 		BIN_PATH=($i) | ||||||
| 		IFS=${IFS_OLD} | 		IFS=${IFS_OLD} | ||||||
| 		if ( ${WHICH} ${BIN_PATH[0]} ); then | 		if ( ${WHICH} ${BIN_PATH[0]}&>/dev/null ); then | ||||||
| 			BIN_FULL="`${WHICH} ${BIN_PATH[0]}`" | 			BIN_FULL="`${WHICH} ${BIN_PATH[0]}`" | ||||||
| 			echo "${BIN_PATH[1]}=\"${BIN_FULL}\"" >>"${TMPCONFIG}" | 			echo "${BIN_PATH[1]}=\"${BIN_FULL}\"" >>"${TMPCONFIG}" | ||||||
|  | 		else | ||||||
|  | 			FAILED_CMD_PATH="${FAILED_CMD_PATH} ${BIN_PATH[0]" | ||||||
|  | 			echo "#${BIN_PATH[1]}=\"\"" >>"${TMPCONFIG}" | ||||||
| 		fi | 		fi | ||||||
| 	done | 	done | ||||||
|  | 	if [ $FAILED_CMD_PATH ]; then | ||||||
|  | 		$WHIPTAIL --title "${TOOL_TITLE}" --msgbox "${FAILED_BINS}\n${FAILED_CMD_PATH}\n${FAILED_BINS_FOOT}" 10 60 | ||||||
|  | 	fi | ||||||
| # | # | ||||||
| #else | #else | ||||||
| fi | fi | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user