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