cellinfo
/
puppet-root
Archived
2
0
Fork 0

Auto-launch ZSH shell for some IP addresses.

This commit is contained in:
Jeremy Gardais 2016-11-28 15:04:55 +01:00
parent db2bf397b9
commit 493b968a5f
3 changed files with 13 additions and 7 deletions

View File

@ -40,6 +40,8 @@ class root (
$profile_content = $root::params::profile_content, $profile_content = $root::params::profile_content,
$bashrc_path = $root::params::bashrc_path, $bashrc_path = $root::params::bashrc_path,
$bashrc_content = $root::params::bashrc_content, $bashrc_content = $root::params::bashrc_content,
$bashrc_content = $root::params::bashrc_content,
$ip_zsh = $root::params::ip_zsh,
) inherits root::params { ) inherits root::params {
include '::root::config' include '::root::config'

View File

@ -8,4 +8,7 @@ class root::params {
$bashrc_path = '/root/.bashrc' $bashrc_path = '/root/.bashrc'
$bashrc_content = 'root/preferences/bashrc.erb' $bashrc_content = 'root/preferences/bashrc.erb'
# For those IP, auto-launch ZSH as default shell
$ip_zsh = '127.0.0.1'
} # Private class: root::params } # Private class: root::params

View File

@ -6,10 +6,11 @@ if [ "$BASH" ]; then
fi fi
fi fi
ZSH_IP="(129.20.79.141|129.20.79.142)" # For those IP, auto-launch ZSH as default shell
IP_ZSH="<%= scope.lookupvar('root::ip_zsh') %>"
if [ "$(echo "${SSH_CLIENT}" | grep -E "${ZSH_IP}")" ]; then
printf '%b' "Launch ZSH\n" if [ "$(echo "${SSH_CLIENT}" | grep -E "${IP_ZSH}")" ]; then
exec zsh exec zsh
fi fi