mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
sourcing of iiab.env moved up for upgrades; indenting cleanup
This commit is contained in:
parent
3c3a481a11
commit
3648753210
1 changed files with 36 additions and 39 deletions
|
@ -1,4 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# upgrades return found, clean installs return 0
|
||||||
|
# interruptions return last stage number recorded (1-9)
|
||||||
|
if [ -f /etc/iiab/iiab.env ]; then
|
||||||
|
source /etc/iiab/iiab.env
|
||||||
|
STAGE=$STAGE
|
||||||
|
else
|
||||||
|
STAGE=0
|
||||||
|
fi
|
||||||
|
|
||||||
OS=`grep ^ID= /etc/*elease|cut -d= -f2`
|
OS=`grep ^ID= /etc/*elease|cut -d= -f2`
|
||||||
OS=${OS//\"/}
|
OS=${OS//\"/}
|
||||||
VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2`
|
VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2`
|
||||||
|
@ -9,62 +19,49 @@ DHCPCD_PATH=`which dhcpcd`
|
||||||
NM_PATH=`which NetworkManager`
|
NM_PATH=`which NetworkManager`
|
||||||
|
|
||||||
case $OS_VER in
|
case $OS_VER in
|
||||||
"fedora-18" | \
|
"fedora-18" | \
|
||||||
"fedora-22" | \
|
"fedora-22" | \
|
||||||
"debian-8" | \
|
"debian-8" | \
|
||||||
"debian-9" | \
|
"debian-9" | \
|
||||||
"ubuntu-16" | \
|
"ubuntu-16" | \
|
||||||
"ubuntu-17" | \
|
"ubuntu-17" | \
|
||||||
"ubuntu-18" | \
|
"ubuntu-18" | \
|
||||||
"centos-7" | \
|
"centos-7" | \
|
||||||
"raspbian-8"| \
|
"raspbian-8"| \
|
||||||
"raspbian-9")
|
"raspbian-9")
|
||||||
;;
|
;;
|
||||||
*) OS_VER="OS_not_supported"
|
*) OS_VER="OS_not_supported"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# get current version
|
# get current version
|
||||||
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||||
COMMIT=`git rev-parse --verify HEAD`
|
COMMIT=`git rev-parse --verify HEAD`
|
||||||
|
|
||||||
if [ -d /usr/lib64/php ]
|
if [ -d /usr/lib64/php ]; then
|
||||||
then
|
PHPLIB_DIR=/usr/lib64/php
|
||||||
PHPLIB_DIR=/usr/lib64/php
|
|
||||||
else
|
else
|
||||||
if [ -d /usr/lib/php5 ]; then
|
if [ -d /usr/lib/php5 ]; then
|
||||||
PHPLIB_DIR=/usr/lib/php5
|
PHPLIB_DIR=/usr/lib/php5
|
||||||
else
|
else
|
||||||
PHPLIB_DIR=/usr/lib/php
|
PHPLIB_DIR=/usr/lib/php
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /proc/device-tree/mfg-data/MN ]
|
if [ -f /proc/device-tree/mfg-data/MN ]; then
|
||||||
then
|
XO_VERSION=`cat /proc/device-tree/mfg-data/MN`
|
||||||
XO_VERSION=`cat /proc/device-tree/mfg-data/MN`
|
|
||||||
else
|
else
|
||||||
XO_VERSION="none"
|
XO_VERSION="none"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# upgrades return found, clean installs return 0
|
|
||||||
# interruptions return last stage number recorded (1-9)
|
|
||||||
if [ -f /etc/iiab/iiab.env ]
|
|
||||||
then
|
|
||||||
source /etc/iiab/iiab.env
|
|
||||||
STAGE=$STAGE
|
|
||||||
else
|
|
||||||
STAGE=0
|
|
||||||
fi
|
|
||||||
ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
|
ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ")
|
||||||
|
|
||||||
if [ ! x$DHCPCD_PATH = x ]
|
if [ ! x$DHCPCD_PATH = x ]; then
|
||||||
then
|
DHCPCD=`systemctl is-enabled dhcpcd`
|
||||||
DHCPCD=`systemctl is-enabled dhcpcd`
|
|
||||||
fi
|
fi
|
||||||
# the check is debian family only is_redhad would use NetworkManager as the
|
# the check is debian family only is_redhad would use NetworkManager as the
|
||||||
# service name.
|
# service name.
|
||||||
if [ ! x$NM_PATH = x ]
|
if [ ! x$NM_PATH = x ]; then
|
||||||
then
|
NM=`systemctl is-enabled network-manager`
|
||||||
NM=`systemctl is-enabled network-manager`
|
|
||||||
fi
|
fi
|
||||||
SYSD_NETD=`systemctl is-enabled systemd-networkd`
|
SYSD_NETD=`systemctl is-enabled systemd-networkd`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue