1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-15 04:03: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 localOsName
local localOsVer 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 if ls --help 2>&1 | grep -i "BusyBox" > /dev/null; then
localOsVar="BusyBox" localOsVar="BusyBox"
else else
@ -151,8 +151,8 @@ function GetLocalOS {
# Get linux versions # Get linux versions
if [ -f "/etc/os-release" ]; then if [ -f "/etc/os-release" ]; then
localOsName=$(GetConfFileValue "/etc/os-release" "NAME") localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true)
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION") localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true)
fi fi
# Add a global variable for statistics in installer # Add a global variable for statistics in installer
@ -165,6 +165,8 @@ function GetLocalOS {
function GetConfFileValue () { function GetConfFileValue () {
local file="${1}" local file="${1}"
local name="${2}" local name="${2}"
local noError="${3:-false}"
local value local value
value=$(grep "^$name=" "$file") value=$(grep "^$name=" "$file")
@ -172,10 +174,15 @@ function GetConfFileValue () {
value="${value##*=}" value="${value##*=}"
echo "$value" echo "$value"
else 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 fi
} }
function SetLocalOSSettings { function SetLocalOSSettings {
USER=root USER=root

File diff suppressed because it is too large Load Diff