2020-04-12 20:05:28 +00:00
|
|
|
package params
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
libparams "github.com/qdm12/golibs/params"
|
|
|
|
|
)
|
|
|
|
|
|
2020-12-29 16:44:35 +00:00
|
|
|
// GetPUID obtains the user ID to use from the environment variable PUID
|
|
|
|
|
// with retro compatible variable UID.
|
|
|
|
|
func (r *reader) GetPUID() (ppuid int, err error) {
|
|
|
|
|
return r.envParams.GetEnvIntRange("PUID", 0, 65535,
|
|
|
|
|
libparams.Default("1000"),
|
|
|
|
|
libparams.RetroKeys([]string{"UID"}, r.onRetroActive))
|
2020-04-12 20:05:28 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-29 16:44:35 +00:00
|
|
|
// GetGID obtains the group ID to use from the environment variable PGID
|
|
|
|
|
// with retro compatible variable PGID.
|
|
|
|
|
func (r *reader) GetPGID() (pgid int, err error) {
|
|
|
|
|
return r.envParams.GetEnvIntRange("PGID", 0, 65535,
|
|
|
|
|
libparams.Default("1000"),
|
|
|
|
|
libparams.RetroKeys([]string{"GID"}, r.onRetroActive))
|
2020-04-12 20:05:28 +00:00
|
|
|
}
|
|
|
|
|
|
2020-10-20 02:45:28 +00:00
|
|
|
// GetTZ obtains the timezone from the environment variable TZ.
|
2020-06-12 17:07:32 +00:00
|
|
|
func (r *reader) GetTimezone() (timezone string, err error) {
|
|
|
|
|
return r.envParams.GetEnv("TZ")
|
2020-04-12 20:05:28 +00:00
|
|
|
}
|