commit
				
					
						e1b62ec560
					
				
			
		
					 7 changed files with 22 additions and 22 deletions
				
			
		| 
						 | 
					@ -24,7 +24,7 @@ state=$(cat "$__object/parameter/state")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$os" in
 | 
					case "$os" in
 | 
				
			||||||
    centos)
 | 
					    centos)
 | 
				
			||||||
        if (source "$__global/explorer/os_release" && [ "${VERSION_ID}" = "7" ]); then
 | 
					        if (. "$__global/explorer/os_release" && [ "${VERSION_ID}" = "7" ]); then
 | 
				
			||||||
          __yum_repo docker-ce-stable \
 | 
					          __yum_repo docker-ce-stable \
 | 
				
			||||||
            --name 'Docker CE Stable' \
 | 
					            --name 'Docker CE Stable' \
 | 
				
			||||||
            --baseurl "https://download.docker.com/linux/centos/7/\$basearch/stable" \
 | 
					            --baseurl "https://download.docker.com/linux/centos/7/\$basearch/stable" \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,9 +30,9 @@ state="$(cat "$__object/parameter/state")"
 | 
				
			||||||
# Use short option names for portability
 | 
					# Use short option names for portability
 | 
				
			||||||
shorten_property() {
 | 
					shorten_property() {
 | 
				
			||||||
   case "$1" in
 | 
					   case "$1" in
 | 
				
			||||||
      gid) echo "-g";;
 | 
					      gid) echo -- "-g";;
 | 
				
			||||||
      password) echo "-p";;
 | 
					      password) echo -- "-p";;
 | 
				
			||||||
      system) echo "-r";;
 | 
					      system) echo -- "-r";;
 | 
				
			||||||
   esac
 | 
					   esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,8 +8,8 @@ debug() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fdisk_command() {
 | 
					fdisk_command() {
 | 
				
			||||||
   local device="$1"
 | 
					   device="$1"
 | 
				
			||||||
   local cmd="$2"
 | 
					   cmd="$2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   debug fdisk_command "running fdisk command '${cmd}' on device ${device}"
 | 
					   debug fdisk_command "running fdisk command '${cmd}' on device ${device}"
 | 
				
			||||||
   printf "${cmd}\nw\n" | fdisk -c -u "$device"
 | 
					   printf "${cmd}\nw\n" | fdisk -c -u "$device"
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@ fdisk_command() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
create_disklabel() {
 | 
					create_disklabel() {
 | 
				
			||||||
   local device=$1
 | 
					   device=$1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   debug create_disklabel "creating new msdos disklabel"
 | 
					   debug create_disklabel "creating new msdos disklabel"
 | 
				
			||||||
   fdisk_command ${device} "o"
 | 
					   fdisk_command ${device} "o"
 | 
				
			||||||
| 
						 | 
					@ -28,18 +28,18 @@ create_disklabel() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
toggle_bootable() {
 | 
					toggle_bootable() {
 | 
				
			||||||
   local device="$1"
 | 
					   device="$1"
 | 
				
			||||||
   local minor="$2"
 | 
					   minor="$2"
 | 
				
			||||||
   fdisk_command ${device} "a\n${minor}\n"
 | 
					   fdisk_command ${device} "a\n${minor}\n"
 | 
				
			||||||
   return $?
 | 
					   return $?
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
create_partition() {
 | 
					create_partition() {
 | 
				
			||||||
  local device="$1"
 | 
					  device="$1"
 | 
				
			||||||
  local minor="$2"
 | 
					  minor="$2"
 | 
				
			||||||
  local size="$3"
 | 
					  size="$3"
 | 
				
			||||||
  local type="$4"
 | 
					  type="$4"
 | 
				
			||||||
  local primary_count="$5"
 | 
					  primary_count="$5"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [ "$type" = "extended" -o "$type" = "5" ]; then
 | 
					  if [ "$type" = "extended" -o "$type" = "5" ]; then
 | 
				
			||||||
    # Extended partition
 | 
					    # Extended partition
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,12 +31,12 @@ debug() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Convert a size specifier 1G 100M or 50% into the corresponding numeric MB.
 | 
					# Convert a size specifier 1G 100M or 50% into the corresponding numeric MB.
 | 
				
			||||||
size_to_mb() {
 | 
					size_to_mb() {
 | 
				
			||||||
   local size=$1
 | 
					   size=$1
 | 
				
			||||||
   local available_size="$2"
 | 
					   available_size="$2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   local number_suffix="$(echo ${size} | sed -e 's:\.[0-9]\+::' -e 's:\([0-9]\+\)\([KkMmGg%]\)[Bb]\?:\1|\2:')"
 | 
					   number_suffix="$(echo ${size} | sed -e 's:\.[0-9]\+::' -e 's:\([0-9]\+\)\([KkMmGg%]\)[Bb]\?:\1|\2:')"
 | 
				
			||||||
   local number="$(echo ${number_suffix} | cut -d '|' -f1)"
 | 
					   number="$(echo ${number_suffix} | cut -d '|' -f1)"
 | 
				
			||||||
   local suffix="$(echo ${number_suffix} | cut -d '|' -f2)"
 | 
					   suffix="$(echo ${number_suffix} | cut -d '|' -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   case "$suffix" in
 | 
					   case "$suffix" in
 | 
				
			||||||
      K|k)
 | 
					      K|k)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,7 +30,7 @@ fi
 | 
				
			||||||
# Don't produce "no pkgs installed" output -- breaks things
 | 
					# Don't produce "no pkgs installed" output -- breaks things
 | 
				
			||||||
PKG_OUTPUT=$(pkg_info 2>&1)
 | 
					PKG_OUTPUT=$(pkg_info 2>&1)
 | 
				
			||||||
if [ ! "$PKG_OUTPUT" = "pkg_info: no packages installed" ]; then
 | 
					if [ ! "$PKG_OUTPUT" = "pkg_info: no packages installed" ]; then
 | 
				
			||||||
	echo -n "$(echo "$PKG_OUTPUT" \
 | 
						printf "%s" "$(echo "$PKG_OUTPUT" \
 | 
				
			||||||
		| awk '{print $1}' \
 | 
							| awk '{print $1}' \
 | 
				
			||||||
		| sed 's/^\(.*\)-\([^-]*\)$/name:\1 ver:\2/g' \
 | 
							| sed 's/^\(.*\)-\([^-]*\)$/name:\1 ver:\2/g' \
 | 
				
			||||||
		| grep "name:$name ver:" \
 | 
							| grep "name:$name ver:" \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Don't produce "no pkgs installed" output -- breaks things
 | 
					# Don't produce "no pkgs installed" output -- breaks things
 | 
				
			||||||
PKG_OUTPUT=$(pkg info 2>&1)
 | 
					PKG_OUTPUT=$(pkg info 2>&1)
 | 
				
			||||||
echo -n "$(echo "$PKG_OUTPUT" \
 | 
					printf "%s" "$(echo "$PKG_OUTPUT" \
 | 
				
			||||||
   | awk '{print $1}' \
 | 
					   | awk '{print $1}' \
 | 
				
			||||||
   | sed 's/^\(.*\)-\([^-]*\)$/name:\1 ver:\2/g' \
 | 
					   | sed 's/^\(.*\)-\([^-]*\)$/name:\1 ver:\2/g' \
 | 
				
			||||||
   | grep "name:$name ver:" \
 | 
					   | grep "name:$name ver:" \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,7 +52,7 @@ cmd=""
 | 
				
			||||||
# Parms: $1 -- mode, "rm", "add", or "upg"
 | 
					# Parms: $1 -- mode, "rm", "add", or "upg"
 | 
				
			||||||
#        $2 -- the command to be echoed
 | 
					#        $2 -- the command to be echoed
 | 
				
			||||||
execcmd(){
 | 
					execcmd(){
 | 
				
			||||||
   local _cmd=""
 | 
					   _cmd=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   case "$1" in
 | 
					   case "$1" in
 | 
				
			||||||
      add)
 | 
					      add)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue