Subversion Repositories ALCASAR

Rev

Rev 2309 | Rev 2472 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2309 Rev 2454
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# $Id: alcasar-importcert.sh 2309 2017-06-26 14:33:22Z tom.houdayer $
3
# $Id: alcasar-importcert.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
4
#
4
#
5
# alcasar-importcert.sh
5
# alcasar-importcert.sh
6
# by Raphaël, Hugo, Clément, Bettyna & rexy
6
# by Raphaël, Hugo, Clément, Bettyna & rexy
7
#
7
#
8
# This script is distributed under the Gnu General Public License (GPL)
8
# This script is distributed under the Gnu General Public License (GPL)
Line 55... Line 55...
55
		hostname=`echo $fqdn | awk -F'.' '{ print $1 }'`
55
		hostname=`echo $fqdn | awk -F'.' '{ print $1 }'`
56
	fi
56
	fi
57
	domain=`echo $fqdn | awk -F'.' '{$1="";OFS=".";print $0}' | sed 's/^.//'`
57
	domain=`echo $fqdn | awk -F'.' '{$1="";OFS=".";print $0}' | sed 's/^.//'`
58
	echo "fqdn=$fqdn hostname=$hostname domain=$domain"
58
	echo "fqdn=$fqdn hostname=$hostname domain=$domain"
59
 
59
 
60
	#check fqdn format      
60
	#check fqdn format
61
	if [[ "$fqdn" != "" && "$domain" != "" ]]; then
61
	if [[ "$fqdn" != "" && "$domain" != "" ]]; then
62
		$SED "s/^HOSTNAME=.*/HOSTNAME=$hostname/g" /usr/local/etc/alcasar.conf
62
		$SED "s/^HOSTNAME=.*/HOSTNAME=$hostname/g" /usr/local/etc/alcasar.conf
63
		$SED "s/^DOMAIN=.*/DOMAIN=$domain/g" /usr/local/etc/alcasar.conf
63
		$SED "s/^DOMAIN=.*/DOMAIN=$domain/g" /usr/local/etc/alcasar.conf
64
		/usr/local/bin/alcasar-conf.sh --apply
64
		/usr/local/bin/alcasar-conf.sh --apply
65
	fi
65
	fi