1
0
mirror of https://github.com/deajan/obackup.git synced 2024-12-24 14:33:41 +01:00

Rebuilt targets

This commit is contained in:
deajan 2018-01-03 22:32:19 +01:00
parent c5ad174a0e
commit f3a9e1d05e
3 changed files with 810 additions and 539 deletions

File diff suppressed because it is too large Load Diff

View File

@ -93,7 +93,7 @@ function GetLocalOS {
local localOsName
local localOsVer
# There's no good way to tell if currently running in BusyBox shell. Using sluggish way.
# There is no good way to tell if currently running in BusyBox shell. Using sluggish way.
if ls --help 2>&1 | grep -i "BusyBox" > /dev/null; then
localOsVar="BusyBox"
else
@ -151,8 +151,8 @@ function GetLocalOS {
# Get linux versions
if [ -f "/etc/os-release" ]; then
localOsName=$(GetConfFileValue "/etc/os-release" "NAME")
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION")
localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true)
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true)
fi
# Add a global variable for statistics in installer
@ -165,6 +165,8 @@ function GetLocalOS {
function GetConfFileValue () {
local file="${1}"
local name="${2}"
local noError="${3:-false}"
local value
value=$(grep "^$name=" "$file")
@ -172,10 +174,15 @@ function GetConfFileValue () {
value="${value##*=}"
echo "$value"
else
Logger "Cannot get value for [$name] in config file [$file]." "ERROR"
if [ $noError == true ]; then
Logger "Cannot get value for [$name] in config file [$file]." "NOTICE"
else
Logger "Cannot get value for [$name] in config file [$file]." "ERROR"
fi
fi
}
function SetLocalOSSettings {
USER=root

File diff suppressed because it is too large Load Diff