do not change parameters
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								5279b7239c
							
						
					
				
			
			
				commit
				
					
						29d4f910bc
					
				
			
		
					 2 changed files with 8 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# 2014 Steven Armstrong (steven-cdist at armstrong.cc)
 | 
			
		||||
# 2014 Nico Schottelius (nico-cdist at schottelius.org)
 | 
			
		||||
#
 | 
			
		||||
# This file is part of cdist.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -18,7 +19,12 @@
 | 
			
		|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
name="$(cat "$__object/parameter/name")"
 | 
			
		||||
if [ -f "$__object/parameter/name" ]; then
 | 
			
		||||
    name="$(cat "$__object/parameter/name")"
 | 
			
		||||
else
 | 
			
		||||
    name="$__target_host"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
os=$(cat "$__global/explorer/os")
 | 
			
		||||
 | 
			
		||||
echo "printf '%s\n' '$name' > /etc/hostname"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
 | 
			
		||||
# 2014 Nico Schottelius (nico-cdist at schottelius.org)
 | 
			
		||||
#
 | 
			
		||||
# This file is part of cdist.
 | 
			
		||||
#
 | 
			
		||||
| 
						 | 
				
			
			@ -18,10 +19,6 @@
 | 
			
		|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# set defaults
 | 
			
		||||
name="$(cat "$__object/parameter/name" 2>/dev/null \
 | 
			
		||||
   || echo "${__target_host%%.*}" | tee "$__object/parameter/name")"
 | 
			
		||||
 | 
			
		||||
os=$(cat "$__global/explorer/os")
 | 
			
		||||
 | 
			
		||||
not_supported() {
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +30,6 @@ not_supported() {
 | 
			
		|||
case "$os" in
 | 
			
		||||
   archlinux|debian|ubuntu)
 | 
			
		||||
      # handled in gencode-remote
 | 
			
		||||
      # FIXED: hostname setup in archlinuz via rc.local ist outdated
 | 
			
		||||
      :
 | 
			
		||||
   ;;
 | 
			
		||||
   *)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue