Skip to content
Browse files

Netmin 7. Submitted by Nishant Singhal, College of Technology, Pantna…

…gar.
  • Loading branch information...
1 parent 950de75 commit d91257872998a02e449c04e66987648384722d75 @rohitgoyal18 committed Dec 14, 2011
Showing with 274 additions and 0 deletions.
  1. +21 −0 netmin/cron.txt
  2. +19 −0 netmin/httpd.txt
  3. +12 −0 netmin/mkfs.txt
  4. +13 −0 netmin/mount.txt
  5. +28 −0 netmin/named.txt
  6. +11 −0 netmin/nfsexport.txt
  7. +13 −0 netmin/nfsimport.txt
  8. +33 −0 netmin/other.txt
  9. +5 −0 netmin/partition.txt
  10. +25 −0 netmin/samba.txt
  11. +72 −0 netmin/script.txt
  12. +13 −0 netmin/start_here.txt
  13. +9 −0 netmin/umount.txt
View
21 netmin/cron.txt
@@ -0,0 +1,21 @@
+#!/bin/bash
+clear
+echo "Enter month(1-12) : "
+read month
+echo "Enter a valid date(1-30 or 31) : "
+read date
+echo "Enter weekday number(Monday is 1) : "
+read weekday
+echo "Enter hours(2400 hrs format) : "
+read hour
+echo "Enter minutes(0-60) : "
+read min
+echo "Enter command to execute : "
+read cmd
+echo "Activate cron as(username) : "
+read user
+clear
+echo "$min $hour $date 0$month $weekday $cmd" >> /var/spool/cron/$user
+clear
+echo "Cron scheduled successfully."
+
View
19 netmin/httpd.txt
@@ -0,0 +1,19 @@
+#!/bin/bash
+clear
+echo "Enter specific ip-address : "
+read ip
+echo "Enter the document root : "
+read root
+echo "Enter the domain name : "
+read name
+echo "<VirtualHost $ip>
+ DocumentRoot \"$root\"
+ ServerName $name
+ <Directory \"$root\">
+ allow from all
+ Options +Indexes
+ </Directory>
+ </VirtualHost>" >> /etc/httpd/conf/httpd.conf
+clear
+echo "Apache creted successfully"
+
View
12 netmin/mkfs.txt
@@ -0,0 +1,12 @@
+#!/bin/bash
+clear
+
+echo "Enter filesystem type : "
+read type
+enter "Enter Partition label(ex- /dev/hda3) : "
+read label
+mkfs -t $type $label
+clear
+echo "Filesystem created successfully"
+
+
View
13 netmin/mount.txt
@@ -0,0 +1,13 @@
+#!/bin/bash
+clear
+echo "Enter filesystem to mount(for ex- \"/dev/hda1\") : "
+read part
+echo "Enter directory where to mount : "
+read dir
+echo "Enter filesystem type : "
+read fs
+mount -t $fs $part $dir -f
+
+echo "Mount successful"
+
+
View
28 netmin/named.txt
@@ -0,0 +1,28 @@
+#!/bin/bash
+clear
+echo "Enter Domain name : "
+read name
+echo "Enter DNS server's ip-address : "
+read address
+echo "Enter e-mail address : "
+read mail
+echo "zone \"$name\" {" >> /etc/named.conf
+echo " type master;" >> /etc/named.conf
+echo " file \"/var/named/$name.hosts\";" >> /etc/named.conf
+echo " };" >> /etc/named.conf
+
+echo "
+\$ttl 38400
+$name. IN SOA Jupiter. $mail. (
+ 120`date +%N | sed -n 's/000//p'`
+ 10800
+ 3600
+ 604800
+ 38400 )
+$name. IN NS nishant
+$name. IN A $address" >> /var/named/$name.hosts
+
+service named restart > /dev/null
+clear
+echo "The DNS record is successfully created."
+
View
11 netmin/nfsexport.txt
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+clear
+echo "Enter directory to export : "
+read mount
+chmod 777 $mount
+echo $mount "*(ro,sync,no_root_squash)" >> /etc/exports
+clear
+echo "NFS export successful"
+
+
View
13 netmin/nfsimport.txt
@@ -0,0 +1,13 @@
+#!/bin/bash
+clear
+
+echo "Enter NFS server ip address : "
+read ip
+echo "Enter source directory : "
+read src
+echo "Enter local directory to mount to : "
+read local
+mount -t nfs $ip:$src $local
+clear
+echo "NFS import successful"
+
View
33 netmin/other.txt
@@ -0,0 +1,33 @@
+#!/bin/bash
+clear
+echo "1) Create a new partition."
+echo "2) Mount a filesystem."
+echo "3) Unmount a filesystem."
+echo "4) Create a filesystem. "
+echo "5) Craete a NFS export."
+echo "6) Create a NFS import."
+echo "Enter your choice(1-6) : "
+read choice
+
+case $choice in
+1) ./partition
+ ;;
+2) ./mount
+ ;;
+3) ./umount
+ ;;
+4) ./mkfs
+ ;;
+5) ./nfsexport
+ ;;
+6) ./nfsimport
+ ;;
+
+*) echo "Invalid option"
+ ;;
+
+esac
+
+
+
+
View
5 netmin/partition.txt
@@ -0,0 +1,5 @@
+#!/bin/bash
+clear
+fdisk /dev/hda
+
+reboot now
View
25 netmin/samba.txt
@@ -0,0 +1,25 @@
+#!/bin/bash
+clear
+echo "Enter share name : "
+read name
+echo "Enter path : "
+read path
+echo "Enter share commnent : "
+read comment
+echo "Enter valid users : "
+read users
+
+echo "[$name]
+ comment = $comment
+ path = $path
+ public = no
+ browseable = yes
+ writable = yes
+ valid users = $users
+ printable = no" >> /etc/samba/smb.conf
+
+clear
+echo "Samba share successful"
+
+
+
View
72 netmin/script.txt
@@ -0,0 +1,72 @@
+#!/bin/bash
+clear
+echo "What do you want to do? "
+echo "1) Create a user."
+echo "2) Create a group."
+echo "3) Delete a user."
+echo "4) Delete a group."
+echo "5) Enter a DNS Record."
+echo "6) Create a Virtual Host(Apache Server)."
+echo "7) Create a Samba Share."
+echo "8) Create a cronjob."
+echo "9) More options..."
+echo "Enter your choice (1-9) : "
+read choice
+
+if test $choice -eq 1
+then
+echo "Enter username : "
+read user
+useradd $user
+clear
+passwd $user
+echo "User created successfully"
+
+elif test $choice -eq 2
+then
+echo "Enter group name : "
+read group
+groupadd $group
+clear
+echo "Group created successfully"
+
+elif test $choice -eq 3
+then
+echo "Enter username to delete : "
+read user
+userdel -r $user
+clear
+echo "User deleted successfully"
+
+
+elif test $choice -eq 4
+then
+echo "Enter groupname to delete : "
+read group
+groupdel $group
+clear
+echo "group deleted successfully"
+
+elif test $choice -eq 5
+then
+./named
+
+
+elif test $choice -eq 6
+then
+./httpd
+
+
+elif test $choice -eq 7
+then
+./samba
+
+elif test $choice -eq 8
+then
+./cron
+
+else test $choice -eq 9
+./other
+fi
+
+
View
13 netmin/start_here.txt
@@ -0,0 +1,13 @@
+#!/bin/bash
+clear
+char=`whoami`
+if test $char != root
+then
+echo "please login as root..."
+echo "enter password for root.."
+su -
+else test $char -eq root
+./script
+fi
+
+
View
9 netmin/umount.txt
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+clear
+echo "Enter directory to unmount : "
+read path
+umount $path
+clear
+echo "Unmount successful"
+

0 comments on commit d912578

Please sign in to comment.
Something went wrong with that request. Please try again.