Add alpine setup functions and sharable script
This commit is contained in:
32
script/include/alpine_setup_functions.inc.sh
Executable file
32
script/include/alpine_setup_functions.inc.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
# alpine_setup_functions: Functions used by the run_alpine_setup script
|
||||
|
||||
update_system_packages() {
|
||||
apk update
|
||||
apk upgrade
|
||||
}
|
||||
|
||||
install_package() {
|
||||
local package_name=${1}
|
||||
|
||||
apk add ${1}
|
||||
return $?
|
||||
}
|
||||
|
||||
add_group() {
|
||||
local group_name="${1}"
|
||||
local gid="${2}"
|
||||
|
||||
addgroup -g "${gid}" -S "${group_name}"
|
||||
return $?
|
||||
}
|
||||
|
||||
add_user() {
|
||||
local username="${1}"
|
||||
local primary_group="${2}"
|
||||
local uid="${3}"
|
||||
|
||||
adduser -u "${3}" -D -S -G "${primary_group}" "${username}"
|
||||
return $?
|
||||
}
|
Reference in New Issue
Block a user