#! /bin/bash
#
# netconfig_run
# little script to check if NetworkManager is running, and stop user from configuring system 
# with the older utility in case they did not realize what they were doing.
#
ps cax | grep NetworkManager > /dev/null
if [ $? -eq 0 ]; then
	yad  --center --window-icon="/usr/share/pixmaps/cancel.png" \
	--image=/usr/share/pixmaps/NetworkManager.png \
	--title="Operation Cancelled"  --margins=12 --fontname="sans bold" \
	--button="gtk-close:0" --text='  NetworkManager is currently running. \n\
	The utility you attempted to run (netconfig) is usually used to\
	set up a simple lan connection that will remain unchanged... \n\
	This may be desirable on older, slower machines, where resources \
	are scant, but to do so you need to go into the SERVICES menu:\n\
	SYSTEM TOOLS -> CONFIGURATION -> RUN SERVICES MENU \n\
	and turn off the network manager. \
	Then reboot, return and run netconfig again...'
else
  xterm -title "Network Config - USE THE KEYBOARD to navigate" -e "sudo /sbin/netconfig"&
  exit 0
fi
exit 0
