Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
2560deec1e | |||
Jérémy Lecour | d01286e0b9 | ||
Jérémy Lecour | 2f2e723bc0 |
|
@ -15,6 +15,12 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
## [23.10.1] - 2023-10-09
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Use a special variable name since USER is always defined from the environment
|
||||||
|
|
||||||
## [23.10] - 2023-10-09
|
## [23.10] - 2023-10-09
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
VERSION="23.10"
|
VERSION="23.10.1"
|
||||||
|
|
||||||
show_version() {
|
show_version() {
|
||||||
cat <<END
|
cat <<END
|
||||||
|
@ -122,8 +122,8 @@ get_now() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_user() {
|
get_user() {
|
||||||
if [ -n "${USER}" ]; then
|
if [ -n "${FORCE_USER}" ]; then
|
||||||
echo "${USER}"
|
echo "${FORCE_USER}"
|
||||||
else
|
else
|
||||||
logname
|
logname
|
||||||
fi
|
fi
|
||||||
|
@ -399,7 +399,7 @@ AUTO=${AUTO:-"0"}
|
||||||
EVOCHECK=${EVOCHECK:-"0"}
|
EVOCHECK=${EVOCHECK:-"0"}
|
||||||
GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20}
|
GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20}
|
||||||
API_ENDPOINT=${API_ENDPOINT:-""}
|
API_ENDPOINT=${API_ENDPOINT:-""}
|
||||||
USER=${USER:-""}
|
FORCE_USER=${FORCE_USER:-""}
|
||||||
|
|
||||||
# initialize variables
|
# initialize variables
|
||||||
MESSAGE=""
|
MESSAGE=""
|
||||||
|
@ -481,12 +481,12 @@ while :; do
|
||||||
# Deprecated, backward compatibility
|
# Deprecated, backward compatibility
|
||||||
# author change as autosysadmin
|
# author change as autosysadmin
|
||||||
printf 'WARNING: "--autosysadmin" is deprecated, use "--user autosysadmin".\n' >&2
|
printf 'WARNING: "--autosysadmin" is deprecated, use "--user autosysadmin".\n' >&2
|
||||||
USER="autosysadmin"
|
FORCE_USER="autosysadmin"
|
||||||
;;
|
;;
|
||||||
-u|--user)
|
-u|--user)
|
||||||
# user options, with value speparated by space
|
# user options, with value speparated by space
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
USER=$2
|
FORCE_USER=$2
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
printf 'ERROR: "--user" requires a non-empty option argument.\n' >&2
|
printf 'ERROR: "--user" requires a non-empty option argument.\n' >&2
|
||||||
|
@ -495,7 +495,7 @@ while :; do
|
||||||
;;
|
;;
|
||||||
--user=?*)
|
--user=?*)
|
||||||
# message options, with value speparated by =
|
# message options, with value speparated by =
|
||||||
USER=${1#*=}
|
FORCE_USER=${1#*=}
|
||||||
;;
|
;;
|
||||||
--user=)
|
--user=)
|
||||||
# message options, without value
|
# message options, without value
|
||||||
|
@ -581,7 +581,7 @@ GIT_REPOSITORIES="/etc /etc/bind /usr/share/scripts"
|
||||||
|
|
||||||
# Add /etc directories from lxc containers if they are git directories
|
# Add /etc directories from lxc containers if they are git directories
|
||||||
if [ -d /var/lib/lxc ]; then
|
if [ -d /var/lib/lxc ]; then
|
||||||
GIT_REPOSITORIES="${GIT_REPOSITORIES} $(find /var/lib/lxc/ -maxdepth 3 -name 'etc' | tr '\n' ' ' | sed 's/[[:space:]]\+$//')"
|
GIT_REPOSITORIES="${GIT_REPOSITORIES} $(find -L /var/lib/lxc/ -maxdepth 3 -name 'etc' | tr '\n' ' ' | sed 's/[[:space:]]\+$//')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# initialize variable
|
# initialize variable
|
||||||
|
|
Loading…
Reference in a new issue