Permalink
Browse files

Netmin 8. Submitted by Shivangi Sreedhar & Shekhar Gupta, NIT Surathkal.

  • Loading branch information...
1 parent d912578 commit d771537e0d6ece84c8f0970cd59af3acd7e071e4 @rohitgoyal18 committed Dec 13, 2011
View
@@ -17,7 +17,7 @@ echo '| 3. NETWORK OPTIONS |'
tput cup 13 30
echo '| 4. HARDWARE OPTIONS |'
tput cup 14 30
-echo '| 5. OTHER IPTIONS |'
+echo '| 5. OTHER OPTIONS |'
tput cup 15 30
echo '| Q. Quit |'
tput cup 16 30
@@ -32,11 +32,11 @@ case $choice in
echo "Press enter to return to main menu. "
read;;
-2) ./server
+2) sh /netmin/rahul/server/server.sh
echo "Press enter to return to main menu. "
read;;
-3) ./network
+3) sh /netmin/rahul/network/network.sh
echo"Press enter to return to main menu "
read;;
View
@@ -0,0 +1,14 @@
+echo "Enter the name of the new virtual interface [ Sample format eth0:1,2,etc ]Please follow the given format or your system will go for a toss ]"
+read name
+ifconfig | grep $name >> /dev/null
+if [ $? -eq 0 ]
+then
+echo "Interface already exists"
+exit 2
+fi
+echo "Enter the ip address of this interface"
+read ip
+echo "Enter the subnet mask of this interface"
+read sub
+ifconfig $name $ip netmask $sub up
+echo "Interface added"
View
@@ -0,0 +1,15 @@
+sh /netmin/rahul/network/dispxinetd.sh|more
+echo "Enter the service name(exactly matching the names above) to be enabled/disabled"
+read name
+clear
+touch /tempo
+a=`cat /etc/xinetd.d/$name|grep 'disable'|cut -d '=' -f 2`
+if [ $a = 'no' ]
+then
+sed '/disable/s/no/yes/' /etc/xinetd.d/$name|sed -n '1,$w /tempo'
+else
+sed '/disable/s/yes/no/' /etc/xinetd.d/$name|sed -n '1,$w /tempo'
+fi
+mv /tempo /etc/xinetd.d/$name
+clear
+sh /netmin/rahul/network/dispxinetd.sh|more
@@ -0,0 +1,13 @@
+echo "Service Disabled?"
+touch dis names
+ls -1 /etc/xinetd.d|cat > names
+count=`wc -l names|cut -d ' ' -f 1`
+for (( n=1; n<=$count; n++ ))
+do
+ name=`sed -n "$n p" names`
+ grep 'disable' /etc/xinetd.d/$name|cut -d '=' -f 2|cat >> dis
+done
+paste -d "\t\t\t\t" names dis|more
+rm dis
+rm names
+
View
@@ -0,0 +1,10 @@
+echo "Enter the name of the interface that you would like to deactivate. Format - eth0, eth0:1,etc. Please follow the format to avoid undesirable results"
+read name
+ifconfig|grep $name >> /dev/null
+if [ $? -ne 0 ]
+then
+echo " This interface is not active"
+exit 2
+fi
+ifconfig $name down
+echo " $name de-activated"
@@ -0,0 +1,64 @@
+ear
+while [ 1 ]
+do
+clear
+echo
+echo
+echo
+tput cup 9 30
+echo '--------------------------------------------------'
+tput cup 10 30
+echo '| 1. Add new virtual interface |'
+tput cup 11 30
+echo '| 2. De-activate the interface |'
+tput cup 12 30
+echo '| 3. View interfaces |'
+tput cup 13 30
+echo '| Q. Quit |'
+tput cup 14 30
+echo '| P. Previous Menu |'
+tput cup 15 30
+echo '| Enter your choice : |'
+tput cup 16 30
+echo '--------------------------------------------------'
+tput cup 23 55
+read choice
+case $choice in
+
+1) sh /netmin/rahul/network/add.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+2) sh /netmin/rahul/network/down.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+3) sh /netmin/rahul/network/show.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+p)
+
+ clear
+ exit;;
+Q)
+
+ clear
+ exit [2];;
+
+q)
+ clear
+ exit [2];;
+
+*) tput cup 30 30
+ echo "IMPROPER CHOICE"
+ tput cup 31 30
+ echo "Press Enter to continue"
+ read id
+esac
+done
+
+
View
@@ -0,0 +1,85 @@
+clear
+while [ 1 ]
+do
+clear
+echo
+echo
+echo
+tput cup 9 30
+echo '--------------------------------------------------'
+tput cup 10 30
+echo '| 1. Network Interfaces(not active at boot) |'
+tput cup 11 30
+echo '| 2. Routing and Gateways |'
+tput cup 12 30
+echo '| 3. Hostname and DNS |'
+tput cup 13 30
+echo '| 4. Host Address |'
+tput cup 14 30
+echo '| 5. Extended Internet Services |'
+tput cup 15 30
+echo '| 6. Apply Changes |'
+tput cup 16 30
+echo '| Q. Quit |'
+tput cup 17 30
+echo '| P. Previous Menu |'
+tput cup 18 30
+echo '| Enter your choice : |'
+tput cup 19 30
+echo '--------------------------------------------------'
+tput cup 23 55
+read choice
+case $choice in
+
+1) sh /netmin/rahul/network/interface.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+2) sh /netmin/rahul/network/routing.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+3) sh /netmin/rahul/network/hostdns.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+4) sh /netmin/rahul/network/hostaddr.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+5) sh /netmin/rahul/network/xinetd.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+6) #service network restart
+ #echo "Changes applied"
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+p)
+
+ clear
+ exit;;
+Q)
+
+ clear
+ exit [2];;
+
+q)
+ clear
+ exit [2];;
+
+*) tput cup 30 30
+ echo "IMPROPER CHOICE"
+ tput cup 31 30
+ echo "Press Enter to continue"
+ read id
+esac
+done
+
View
@@ -0,0 +1 @@
+ifconfig |more
View
@@ -0,0 +1,70 @@
+clear
+while [ 1 ]
+do
+clear
+echo
+echo
+echo
+tput cup 9 30
+echo '--------------------------------------------------'
+tput cup 10 30
+echo '| 1. Display the list of services |'
+tput cup 11 30
+echo '| 2. Enable or disable a service |'
+tput cup 12 30
+echo '| 3. Start service/Apply changes |'
+tput cup 13 30
+echo '| Q. Quit |'
+tput cup 14 30
+echo '| P. Previous Menu |'
+tput cup 15 30
+echo '| Enter your choice : |'
+tput cup 16 30
+echo '--------------------------------------------------'
+tput cup 23 55
+read choice
+case $choice in
+
+1) sh /netmin/rahul/network/dispxinetd.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+2) sh /netmin/rahul/network/chxinetd.sh
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+3) service xinetd restart > /dev/null
+ echo "Changes saved... xinetd running"
+ tput cup 30 30
+ echo "Press enter to return to the menu. "
+ read;;
+
+
+P)
+
+ clear
+ exit;;
+p)
+
+ clear
+ exit;;
+Q)
+
+ clear
+ exit [2];;
+
+q)
+ clear
+ exit [2];;
+
+*) tput cup 30 30
+ echo "IMPROPER CHOICE"
+ tput cup 31 30
+ echo "Press Enter to continue"
+ read id
+esac
+done
+
+
View
@@ -0,0 +1,8 @@
+echo "Enter the domain name"
+read name
+echo "Enter absolute name (can be master or child): "
+read new
+echo "Enter address : "
+read ad
+echo "$new. IN A $ad" |cat >> /var/named/chroot/var/named/$name.hosts
+
View
@@ -0,0 +1,18 @@
+echo "Enter ip address for this web server"
+read ip
+echo "Enter the name of the server"
+read name
+echo "Give the path of the document root"
+read root
+mkdir $root
+echo "This page is under construction"|cat >> $root/index.html
+echo "
+<VirtualHost $ip>
+DocumentRoot "'"'$root'"'"
+ServerName $name
+<Directory "'"'$root'"'">
+allow from all
+Options +Indexes
+</Directory>
+</VirtualHost>" | cat >> /etc/httpd/conf/httpd.conf
+service httpd restart
Oops, something went wrong.

0 comments on commit d771537

Please sign in to comment.