41 lines
906 B
Bash
41 lines
906 B
Bash
|
#!/bin/bash -e
|
||
|
|
||
|
echo "Start rsyslog service..."
|
||
|
service rsyslog start
|
||
|
echo done.
|
||
|
|
||
|
if [ -d /srv/ssh ]
|
||
|
then
|
||
|
if [ -n "$( ls /srv/ssh/*.conf 2> /dev/null )" ]
|
||
|
then
|
||
|
echo "Install custom SSH configuration files..."
|
||
|
cp /srv/ssh/*.conf /etc/ssh/sshd_config.d/
|
||
|
echo done.
|
||
|
else
|
||
|
echo "No custom SSH configuration files found. Put it in /srv/ssh if need (with .conf extension)."
|
||
|
fi
|
||
|
|
||
|
if [ -e /srv/ssh/authorized_keys ]
|
||
|
then
|
||
|
echo "Install SSH authorized keys (from /srv/ssh/authorized_keys file)"
|
||
|
cat /srv/ssh/authorized_keys > /root/.ssh/authorized_keys
|
||
|
else
|
||
|
echo "No SSH authorized keys to install. Put it in /srv/ssh/authorized_keys file."
|
||
|
fi
|
||
|
|
||
|
echo "Start SSH service..."
|
||
|
service ssh start
|
||
|
echo done.
|
||
|
fi
|
||
|
|
||
|
if [ -d /srv/openvpn ]
|
||
|
then
|
||
|
cp /srv/openvpn/* /etc/openvpn
|
||
|
service openvpn start
|
||
|
else
|
||
|
echo "OpenVPN configuration directory not mount (/srv/openvpn)"
|
||
|
fi
|
||
|
|
||
|
echo "Run BASH shell"
|
||
|
bash -l
|