#!/bin/bash
#
# Userinterface OsirisCS RC1.5.1
# Scriptauthors athlon1900,cepheus62
# (c)2014-2024 OsirisCS-Dev-Team
#


Version="Interface RC 1.5.1"
Domain="ftp://osiriscs-ftp.dnshome.at"
var1="$1"
osirisdir="OsirisCS-$( uname -m )"
archtools=$( uname -m )

#
toolselect()
	{
	if [ "$archtools" == "aarch64" ] || [ "$archtools" == "armv6l" ] || [ "$archtools" == "armv7l" ] ;
	then
		Tools="Softcam-install-online Softcam-install-offline Softcam-uninstall Picon-install Picon-uninstall OScam-Template-install OScam-Template-uninstall Edit_cs.conf Stop_Softcam(s) Start_Softcam(s) Restart_Softcam(s) Edit/Create_Cronjob Change_OsirisCS_User Change_OsirisCS_Password Setup_Network Reboot_Server Exit"
	fi
	if [ "$archtools" == "x86_64" ] ;
	then
		Tools="Softcam-install-online Softcam-install-offline Softcam-uninstall Picon-install Picon-uninstall OScam-Template-install OScam-Template-uninstall Edit_cs.conf Stop_Softcam(s) Start_Softcam(s) Restart_Softcam(s) Edit/Create_Cronjob Change_OsirisCS_User Change_OsirisCS_Password Setup_Network Server_Backup Reboot_Server Exit"
	fi
	if [ "$archtools" == "i386" ] || [ "$archtools" == "i486" ] || [ "$archtools" == "i586" ] || [ "$archtools" == "i686" ] ;
	then 
		clear
		echo -e "\t\033[1;37;40mThe support for the x86 architecture has expired.\033[0m"
		echo -e "\t\033[1;37;40mPlease switch to the x86_64 architecture.\033[0m"
		sleep 3
		exit
	fi
	}


#
download()
	{
	wget -q $Domain/$osirisdir/$1 -P"/tmp" --timeout=10
	if [ $? -gt 0 ];
	then
		echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
		echo -e "\t\033[1;37;40mOsirisCS-Server is temporarily unavailable\033[0m"
		echo -e "\t\033[1;37;40mPlease try again a later\033[0m"
	else
		echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m"
	fi
	if ! [ -e /tmp/IF-News ];
	then
		echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
		echo -e "\t\033[1;37;40mDownload fail\033[0m"
		echo -e ""
	fi
	}


#
tool-handling()
	{
	echo -e "\033[1;34;40m$(printf "%-s\n" "      ###           #         #           ###   ####" "     #   #                               #     #" "    #     #   ####  #  # ###  #   ####  #      #" "    #     #  #      #  ##     #  #      #       ###" "    #     #   ###   #  #      #   ###   #          #" "     #   #       #  #  #      #      #   #         #" "      ###    ####   #  #      #  ####     ###  ####	";)$Version\033[0m\n"
	echo -e "\033[1;32;40m$OsirisCSNews\033[0m\n"
	PS3="Please make a choice : "
	select tool in $Tools
	do
		case $tool in
			"") echo "Invalid selection" ;;
			 *) break
		esac
	done
	}


#
softcam-install-online()
	{
	list=OsirisCS-Softcam.list
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo -e -n "\n\t\033[1;37;40mDownload:\t\033[1;32;40m$list \033[0m\n\n\n"
	download $list
	sleep 3 ; clear
	PS3="Please choose a softcam to install from list : "
	select softcam in $(cat /tmp/$list 2>/dev/null | egrep '(Camd|CCcam|OSEmu|DOScam|rc)' | sort -V | more; cat /tmp/$list 2>/dev/null | grep modern | tail -n 10 | sort -V | more; cat /tmp/$list 2>/dev/null | tail -n 10 | sort -V | more) exit
	do
		case "$softcam" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/$list ; break ;;
			 *)  echo "You selected $softcam "
			     echo $softcam >> /tmp/softcam.txt
			     EMUDIR=$(grep '_' /tmp/softcam.txt | cut -d '_' -f1 )
			     EMUVERSION=$(grep '_' /tmp/softcam.txt | cut -d '_' -f2 )
			     /bin/osiris_install online $EMUDIR $EMUVERSION
			     rm -f /tmp/softcam.txt
			     rm -f /tmp/$list
			     sleep 3 ; clear ; break
		esac
	done
	}


#
softcam-install-offline()
	{
	clear
	echo "You selected $tool" ; sleep 3 ; clear
	echo "[progress] Searching for softcam-install-packs in folder /tmp" ; sleep 3 ; clear
	PS3="Please choose a softcam to install from list : "
	select softcam in $(ls /tmp | grep '.tar' | sort -V | more ) exit
	do
		case "$softcam" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/$list ; break ;;
			 *)  echo "You selected $softcam "
			     echo $softcam >> /tmp/softcam.txt
			     sed -e "s/.tar.gz//" /tmp/softcam.txt > /tmp/softcam2.txt
			     EMUDIR=$(grep '_' /tmp/softcam2.txt | cut -d '_' -f1 )
			     EMUVERSION=$(grep '_' /tmp/softcam2.txt | cut -d '_' -f2 )
			     /bin/osiris_install offline $EMUDIR $EMUVERSION
			     rm -f /tmp/softcam.txt
			     rm -f /tmp/softcam2.txt
			     sleep 3 ; clear ; break
		esac
	done
	}


#
softcam-uninstall()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo "[progress] Generate list of installed softcams."
	cd /usr/cs/Cams
	ls >> /tmp/Cams.list1
	sed -e "/.rotate/"d /tmp/Cams.list1 > /tmp/Cams.list2
	sed -e "s/.sh//" /tmp/Cams.list2 > /tmp/Cams.list
	rm -f /tmp/Cams.list1
	rm -f /tmp/Cams.list2
	sleep 3
	cd - >> /dev/null
	clear
	PS3="Please choose a softcam to uninstall from list : "
	select softcam in $(cat /tmp/Cams.list | sort -V) exit
	do
		case "$softcam" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/Cams.list ; break ;;
			 *)  echo "You selected $softcam "
			     sleep 3
			     echo $softcam >> /tmp/softcam.txt
			     EMUDIR=$(grep '_' /tmp/softcam.txt | cut -d '_' -f1 )
			     EMUVERSION=$(grep '_' /tmp/softcam.txt | cut -d '_' -f2 )
			     /bin/osiris_install uninstall $EMUDIR $EMUVERSION
			     rm -f /tmp/softcam.txt
			     rm -f /tmp/Cams.list
			     sleep 3 ; clear ; break
		esac
	done
	}


#
picon-install()
	{
	list=OsirisCS-Picons.list
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo -e -n "\n\t\033[1;37;40mDownload:\t\033[1;32;40m$list \033[0m\n\n\n"
	download $list
	sleep 3 ; clear
	PS3="Please choose a Picon-pack from list : "
	select picons in $(cat /tmp/$list | sort -V | more) exit
	do
		case "$picons" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/$list ; break ;;
			 *)  echo "You selected $picons "
			     /bin/osiris_picon online $picons
			     rm -f /tmp/$list
			     sleep 3 ; clear ; break
		esac
	done
	}


#
picon-uninstall()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo "[progress] Generate list of installed picon-packs."
	cd /usr/cs/picon
	ls >> /tmp/picon.list1
	sed -e "/picon.sh/"d /tmp/picon.list1 > /tmp/picon.list2
	sed -e "s/.list//" /tmp/picon.list2 > /tmp/picon.list
	rm -f /tmp/picon.list1
	rm -f /tmp/picon.list2
	sleep 3
	cd - >> /dev/null
	clear
	PS3="Please choose a picon-pack to uninstall from list : "
	select picon in $(cat /tmp/picon.list | sort -V) exit
	do
		case "$picon" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/picon.list ; break ;;
			 *)  echo "You selected $picon "
			     sleep 3
			     /bin/osiris_picon uninstall $picon
			     rm -f /tmp/picon.list
			     sleep 3 ; clear ; break
		esac
	done
	}


#
oscam-template-install()
	{
	list=OsirisCS-Themes.list
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo -e -n "\n\t\033[1;37;40mDownload:\t\033[1;32;40m$list \033[0m\n\n\n"
	download $list
	sleep 3 ; clear
	PS3="Please choose a OScam-Template-Pack from list : "
	select themes in $(cat /tmp/$list | sort -V | more) exit
	do
		case "$themes" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/$list ; break ;;
			 *)  echo "You selected $themes "
			     /bin/osiris_theme online $themes
			     rm -f /tmp/$list
			     sleep 3 ; clear ; break
		esac
	done
	}
#
oscam-template-uninstall()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo "[progress] Generate list of installed oscam-templates."
	cd /usr/cs/theme
	ls >> /tmp/theme.list1
	sed -e "/osiris_theme.sh/"d /tmp/theme.list1 > /tmp/theme.list2
	sed -e "/.list/"d /tmp/theme.list2 > /tmp/theme.list3
	sed -e "s/.sh//" /tmp/theme.list3 > /tmp/theme.list
	rm -f /tmp/theme.list1
	rm -f /tmp/theme.list2
	rm -f /tmp/theme.list3
	sleep 3
	cd - >> /dev/null
	clear
	PS3="Please choose a oscam-template to uninstall from list : "
	select theme in $(cat /tmp/theme.list | sort -V) exit
	do
		case "$theme" in
			"")  echo "Invalid selection" ;;
		     exit)  rm -f /tmp/theme.list ; break ;;
			 *)  echo "You selected $theme "
			     sleep 3
			     /bin/osiris_theme uninstall $theme
			     rm -f /tmp/theme.list
			     sleep 3 ; clear ; break
		esac
	done
	}


#
editconf()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	nano /usr/cs/cs.conf
	}


#
softcam-start()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	/bin/osiris_start start
	sleep 3
	}


#
softcam-stop()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	/bin/osiris_start stop
	sleep 3
	}


#
softcam-restart()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	/bin/osiris_start restart
	sleep 3
	}


#
restart-server()
	{
	clear
	echo "You selected $tool" ; sleep 3
	answer=""
	while :
	do
		case "$answer" in
			yes) echo -e -n "You typed in: $answer \n\033[1;31;40mSystem is rebooting now.\033[0m\n\n" ; sleep 3 ; shutdown -r now ; exit 0 ;;
			 no) echo -e -n "You typed in: $answer \n\033[1;32;40mExiting now.\033[0m\n" ; break ;;
			  *) clear ; echo -e -n "\n\033[1;31;40mSystem is going down for reboot !! \033[0m\n" ; echo -e -n "Are you sure that you want to reboot (type in: yes or no) ? " ; read answer
		esac
	done
	sleep 3
	}


#
cronjob()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	PS3="Please choose a function from list : "
	select cronjob1 in new edit delete
	do
		case "$cronjob1" in
			"")  echo "Invalid selection" ;;
			 *)  echo "You selected $cronjob1 "
			     if [ $cronjob1 == "new" ]
			     then
			     	cronjob1="neu"
			     fi
			     if [ $cronjob1 == "edit" ]
			     then
			     	cronjob1="aendern"
			     fi
			     if [ $cronjob1 == "delete" ]
			     then
			     	cronjob1="loeschen"
			     fi
			     sleep 3 ; clear ; break
		esac
	done		
	PS3="Please choose an command from list : "
	select cronjob2 in restart_system restart_cam exit
	do
		case "$cronjob2" in
			"")  echo "Invalid selection" ;;
		     exit)  break ;;
			 *)  echo "You selected $cronjob2 "
			     sleep 3 ; clear
			     /bin/osiris_cron $cronjob1 $cronjob2
			     sleep 3 ; break
		esac
	done
	}


#
change-password()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo "[progress] Searching for Apache2-user"	
	apacheuser=$(grep ':' /etc/apache2/passwd | cut -d ':' -f1 )
	sleep 2 ; echo "got $apacheuser for changing password" ; sleep 3
	/bin/osiris_passwd $apacheuser
	sleep 3
	}


#
change-user()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	echo "[progress] Searching for current Apache2-user"	
	apacheuser=$(grep ':' /etc/apache2/passwd | cut -d ':' -f1 )
	sleep 2 ; echo "got $apacheuser for changing" ; sleep 3
	echo "Please type in the new OsirisCS-user : " ; read apacheusernew
	/bin/osiris_apache_user $apacheuser $apacheusernew
	sleep 3
	}


#
backup()
	{
	clear
	echo "You selected $tool" ; sleep 3
	clear
	PS3="Where should the backup be created : "
	select backup1 in USB FTP-Server exit
	do
		case "$backup1" in
			"")  echo "Invalid selection" ;;
		      exit)  break ;;
		       USB)  echo "You selected $backup1 "
			     usblocation=$(grep 'USB-Stick:' /usr/cs/cs.conf | cut -d ':' -f2 )
			     daytime=$(date +"%Y.%m.%d-%H.%M")
			     echo "how should the backup be named ?" ; read name
			     imagename=$name"_"$daytime
			     clear
			     echo -e -n "\n\t\033[1;37;40mChecking directories\033[0m"
				if [ ! -d /tmp/stick >> /dev/null 2>&1 ];
				then
					mkdir /tmp/stick >> /dev/null 2>&1
				fi
				if [ $? -gt 0 ];
				then
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
				echo -e -n "\t\033[1;37;40mUnmount USB-stick\033[0m"
				umount $usblocation >> /dev/null 2>&1
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m\n"
				sleep 3 ; clear ; break
				else
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m"
				fi
			     echo -e -n "\t\033[1;37;40mMounting USB-Stick\033[0m"
			     mount $usblocation /tmp/stick >> /dev/null 2>&1
				if [ $? -gt 0 ];
				then
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
				echo -e -n "\t\033[1;37;40mUnmount USB-stick\033[0m"
				umount $usblocation >> /dev/null 2>&1
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m\n"
				sleep 3 ; clear ; break
				else
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m"
				fi
			     echo -e -n "\033[1;37;40m"
			     dd if=/dev/sda | pv -N Create_OsirisCS-Image | gzip > /tmp/stick/$imagename.img.gz
				if [ $? -gt 0 ];
				then
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
				echo -e -n "\t\033[1;37;40mUnmount USB-stick\033[0m"
				umount $usblocation >> /dev/null 2>&1
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m\n"
				sleep 3 ; clear ; break
				else
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m"
				fi
			     echo -e -n "\t\033[1;37;40mBackup successfully created\033[0m" ; sleep 3
			     echo -e -n "\t\033[1;37;40mUnmounting USB-Sick\033[0m"
			     umount $usblocation >> /dev/null 2>&1
			     echo -e "\n"
			     sleep 3 ; clear ; break ;;
	        FTP-Server)  echo "You selected $backup1"
			     daytime=$(date +"%Y.%m.%d-%H.%M")
			     echo "How should the backup be named ?" ; read name
			     imagename=$name"_"$daytime
			     echo -e -n "\n\033[1;37;40mUser : \t\t\033[0m" ; read user
			     echo -e -n "\033[1;37;40mPassword : \t\033[0m" ; read -s pw
			     echo -e -n "\n\033[1;37;40mFTP IP-address : \t\033[0m" ; read add
			     echo -e -n "\033[1;37;40mPort : \t\t\033[0m" ; read port
			     echo -e -n "\n"
			     dd if=/dev/sda | pv -N Create_OsirisCS-Image | gzip -9 - | ncftpput -V -P $port -u $user -p $pw -c $add  /$imagename.img.gz >> /dev/null 2>&1
			     if [ $? -gt 0 ];
			     then
				echo -e -n "\n\t\033[1;37;40mError writing image to FTP-Server\033[0m"
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;31;40m FAIL \033[1;37;40m\0135\033[0m"
			     else
				echo -e -n "\n\t\033[1;37;40mImage successfully write to FTP-Server\033[0m"
				echo -e "\033[500C\033[8D\033[1;37;40m\0133\033[1;32;40m DONE \033[1;37;40m\0135\033[0m\n"
			     fi
			     sleep 3 ; clear ; break		     
		esac
	done
	}


#
help()
	{
	if [ "$var1" != "" ]
	then
	case "$var1" in
    		-v | --version )
				clear
				echo -e "\n\t\033[1;33;40mOSirisCS $Version\033[0m"
				echo -e "\t\033[1;32;40mAuthors : athlon1900 , cepheus62\033[0m"
				echo -e "\t\033[1;32;40m(c)2014-2024 OsirisCS-Dev-Team\033[0m\n"
				exit 0 ;;
  		  -a | --about )
				clear
				echo -e "\n\tThe OsirisCS Interface is easy to use and a tool to control your"
				echo -e "\tOsirisCS-Server."
				echo -e "\tIt provides you with messages from the OsirisCS-Download-Server,"
				echo -e "\twhich will be displayed in the color green."
				echo -e "\tThe OsirisCS Interface is NOT a must have,it makes it easier to work"
				echo -e "\twith OsirisCS.\n"
				exit 0 ;;
			    * )
				clear
				echo "usage:	$0 [-Options]"
				echo "Options:"
				echo "-v  --version		Display the OsirisCS-IF Version"
				echo "-a  --about		About the OsirisCS-IF"
				exit 0
				break ;;
	esac
	fi
	}


#
setupnetwork()
	{
	clear
	echo "You selected $tool" ; sleep 3
	networkfile="/etc/network/interfaces"
	dnsserverfile="/etc/resolv.conf"
	while :
	do
		clear
		PS3="Please choose an option from list : "
		select networkoption in DHCP static-IP show_network_config change_hostname show_hostname exit
		do
			case "$networkoption" in
				"")  echo "Invalid selection" ;;
			         *)  break
			esac
		done
		if [ $networkoption == "DHCP" ]
		then
			sleep 3 ; clear ; echo "[progress] Generate new file $networkfile"
			rm -f $networkfile
			touch $networkfile
			echo -e "# /etc/network/interfaces generated by OsirisCS $Version\n# (c)2014-2023 OsirisCS-Dev-Team\n#\nauto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet dhcp" >> $networkfile
			sleep 3 ; clear ; echo -e "$networkfile generated\nPlease reboot your OsirisCS-Server to activate the new settings." ; sleep 5
		fi
		if [ $networkoption == "static-IP" ]
		then
			clear ; echo -e -n "Enter the new IP-Adress : " ; read ipadress
			echo -e -n "Enter the new Subnetmask : " ; read subnetmask 
			echo -e -n "Enter the new Gateway : " ; read gateway
			echo -e -n "Enter the new DNS-Nameserver : " ; read dnsserver
			sleep 3 ; clear ; echo "[progress] Generate new file $networkfile"
			rm -f $networkfile
			touch $networkfile
			rm -f $dnsserverfile
			touch $dnsserverfile
			echo -e "# $networkfile generated by OsirisCS $Version\n# (c)2014-2023 OsirisCS-Dev-Team\n#\nauto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet static\naddress $ipadress\nnetmask $subnetmask\ngateway $gateway\ndns-nameservers $dnsserver " >> $networkfile
			echo -e "# $dnsserverfile generated by OsirisCS $Version\n# (c)2014-2023 OsirisCS-Dev-Team\n#\nnameserver $dnsserver " >> $dnsserverfile

			sleep 3 ; clear ; echo -e "$networkfile generated\nPlease reboot your OsirisCS-Server to activate the new settings." ; sleep 5
		fi
		if [ $networkoption == "show_network_config" ]
		then
			nano $networkfile
		fi
		if [ $networkoption == "change_hostname" ]
		then
			clear ; echo -e -n "Enter the new hostname : " ; read _hostname ; echo $_hostname > /etc/hostname ; service hostname stop 2>/dev/null ; service hostname start 2>/dev/null
			sleep 3 ; echo -e "\nThe new hostname \033[1;32;40m$( hostname )\033[0m is active." ; sleep 5
		fi
		if [ $networkoption == "show_hostname" ]
		then
			clear ; echo -e "\n\t\033[1;33;40mYour hostname is : \033[1;32;40m$( hostname )\033[0m\n" ; sleep 7
		fi
		if [ $networkoption == "exit" ]
		then
			break
		fi
	done
	}


#
#
# Program start
#			
help
toolselect
download IF-News
OsirisCSNews=$( cat /tmp/IF-News  2>/dev/null )
while :
do
	clear
	tool-handling
		if [ $tool == "Softcam-install-online" ]
		then softcam-install-online
		fi
		if [ $tool == "Softcam-install-offline" ]
		then softcam-install-offline
		fi
		if [ $tool == "Softcam-uninstall" ]
		then softcam-uninstall
		fi
		if [ $tool == "Picon-install" ]
		then picon-install
		fi
		if [ $tool == "Picon-uninstall" ]
		then picon-uninstall
		fi
		if [ $tool == "OScam-Template-install" ]
		then oscam-template-install
		fi
		if [ $tool == "OScam-Template-uninstall" ]
		then oscam-template-uninstall
		fi
		if [ $tool == "Edit_cs.conf" ]
		then editconf
		fi
		if [ $tool == "Start_Softcam(s)" ]
		then softcam-start
		fi
		if [ $tool == "Stop_Softcam(s)" ]
		then softcam-stop
		fi
		if [ $tool == "Restart_Softcam(s)" ]
		then softcam-restart
		fi
		if [ $tool == "Edit/Create_Cronjob" ]
		then cronjob
		fi
		if [ $tool == "Change_OsirisCS_User" ]
		then change-user
		fi
		if [ $tool == "Change_OsirisCS_Password" ]
		then change-password
		fi
		if [ $tool == "Setup_Network" ]
		then setupnetwork
		fi
		if [ $tool == "Server_Backup" ]
		then backup
		fi
		if [ $tool == "Reboot_Server" ]
		then restart-server
		fi
		if [ $tool == "Exit" ]
		then clear ; rm -f /tmp/IF-News ; break
		fi
done	
clear
exit 0