Script menghapus virtual host / subdomain di apache
Kalau di script sebelumnya adalah membuat subdomain baru, maka scrip berikut adalah berfungsi sebaliknya, yaitu menghapus subdomain yang sudah dibuat
#!/bin/sh
#Untuk menghapus virtual host
HOME=”/home”
VHOST=”/etc/httpd/conf/vhost”
NamaHost=$1
NamaDomain=$2
DoDelvHost()
{
if [ -e $VHOST/$NamaHost.$NamaDomain.conf ]; then
rm $VHOST/$NamaHost.$NamaDomain.conf -f
fi
}
DoDelHome()
{
if [ -d $HOME/$NamaHost ]; then
rm $HOME/$NamaHost -rf
fi
}
DoFileList()
{
for filenya in $HOME/$NamaHost/public_html/*; do
echo $filenya
done
}
DoDelUser()
{
/usr/sbin/userdel $NamaHost
}
echo “Scrip akan menghapus vHost $NamaHost.$NamaDomain”
echo “Directori $HOME/$NamaHost/public_html yang berisi:”
DoFileList
echo “Akan dihapus? (y/n)”
read TANYA
if [ $TANYA=y ]; then
DoDelvHost
DoDelHome
DoDelUser
fi
Dari scrip ini informasi yang dapat diambil yaitu:
1. Dipanggil seperti script sebelumnya, yaitu menyertakan parameter namahost dan namadomain
2. Untuk mengeceka keberadaan folder dengan if [ -d $HOME/$NamaHost ], dimana -d adalah opsinya
3. Dilayar akan dimunculkan tampilan isi dari folder public_html
4. Dilakukan konfirmasi apakah akan di hapus
5. Yang dihapus yaitu konfigurasi virtual host, home directori dan usernya
Minggu, 07 Februari 2010
Langganan:
Posting Komentar (Atom)
Free Download
Ulead GIF Animator 5.0 full.exe
Aktivator Windows 7.exe
Mass Storage Driver.exe
WIndows 7 Free.exe
Windows 7 Full patch.exe
ChromeSetup.exe
Windows Seven Transformation Pack.exe
AIO WIndows Genuine Validation.exe
Windows Vista Activator.exe
ultimate-transformation.exe
Windows XP Crystal V3.exe
Kumpulan Software
Security Officer for Windows 7
Smadav 2010 Rev. 8.0.exe
4shared_Desktop_3.1.0.exe"
Aktivator Windows 7.exe
Mass Storage Driver.exe
WIndows 7 Free.exe
Windows 7 Full patch.exe
ChromeSetup.exe
Windows Seven Transformation Pack.exe
AIO WIndows Genuine Validation.exe
Windows Vista Activator.exe
ultimate-transformation.exe
Windows XP Crystal V3.exe
Kumpulan Software
Security Officer for Windows 7
Smadav 2010 Rev. 8.0.exe
4shared_Desktop_3.1.0.exe"
0 komentar:
Posting Komentar