Subversion Repositories ALCASAR

Rev

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

Rev 2554 Rev 2688
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# $Id: alcasar-importcert.sh 2554 2018-05-20 11:02:46Z lucas.echard $
3
# $Id: alcasar-importcert.sh 2688 2019-01-18 23:15:49Z lucas.echard $
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 171... Line 171...
171
			fi
171
			fi
172
			echo "Importing certificate $cert with private key $key and server-chain $sc"
172
			echo "Importing certificate $cert with private key $key and server-chain $sc"
173
		fi
173
		fi
174
		domainName $cert
174
		domainName $cert
175
		certImport $cert $key $sc
175
		certImport $cert $key $sc
176
		for services in chilli dnsmasq dnsmasq-blackhole dnsmasq-blacklist dnsmasq-whitelist lighttpd
176
		for services in chilli unbound unbound-blackhole unbound-blacklist unbound-whitelist dnsmasq-whitelist lighttpd
177
		do
177
		do
178
			echo "restarting $services"; systemctl restart $services; sleep 1
178
			echo "restarting $services"; systemctl restart $services; sleep 1
179
		done
179
		done
180
		;;
180
		;;
181
	-d)
181
	-d)
182
		if [ -f "/etc/pki/tls/certs/alcasar.crt.old" -a -f "/etc/pki/tls/private/alcasar.key.old" ]
182
		if [ -f "/etc/pki/tls/certs/alcasar.crt.old" -a -f "/etc/pki/tls/private/alcasar.key.old" ]
183
		then
183
		then
184
			echo "Restoring default certificate"
184
			echo "Restoring default certificate"
185
			defaultCert
185
			defaultCert
186
			defaultNdd
186
			defaultNdd
187
			for services in chilli dnsmasq dnsmasq-blackhole dnsmasq-blacklist dnsmasq-whitelist lighttpd
187
			for services in chilli unbound unbound-blackhole unbound-blacklist unbound-whitelist dnsmasq-whitelist lighttpd
188
			do
188
			do
189
				echo "restarting $services"; systemctl restart $services; sleep 1
189
				echo "restarting $services"; systemctl restart $services; sleep 1
190
			done
190
			done
191
		fi
191
		fi
192
		;;
192
		;;