This commit is contained in:
38
install.sh
38
install.sh
@@ -183,10 +183,11 @@ check_dirs_and_files() {
|
||||
|
||||
check_running() {
|
||||
|
||||
# Custom gentoo docker status check
|
||||
DOCKERD_STATUS=$($SUDO_CMD rc-status 2>/dev/null | grep docker | grep started | wc -l);
|
||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
||||
DOCKERD_STATUS="0";
|
||||
|
||||
which systemctl;
|
||||
|
||||
if [ "$?" == "0" ]; then
|
||||
DOCKERD_STATUS=$($SUDO_CMD systemctl status docker | grep running | wc -l)
|
||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
||||
$SUDO_CMD systemctl start docker
|
||||
@@ -197,6 +198,27 @@ check_running() {
|
||||
exit;
|
||||
fi
|
||||
fi
|
||||
DEBIAN="true";
|
||||
else
|
||||
echo "systemctl was not found";
|
||||
echo "Do you want to continue? (Y/n)";
|
||||
read -r ANSWER;
|
||||
if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
||||
# Custom gentoo docker status check
|
||||
DOCKERD_STATUS=$($SUDO_CMD rc-status 2>/dev/null | grep docker | grep started | wc -l);
|
||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
||||
$SUDO_CMD /etc/init.d/docker start
|
||||
sleep 5;
|
||||
DOCKERD_STATUS=$($SUDO_CMD rc-status 2>/dev/null | grep docker | grep started | wc -l);
|
||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
||||
echo "Docker daemon not running, please check and execute again the install script";
|
||||
exit;
|
||||
fi
|
||||
fi;
|
||||
GENTOO="true";
|
||||
else
|
||||
exit;
|
||||
fi;
|
||||
fi
|
||||
|
||||
# bridge check
|
||||
@@ -836,6 +858,7 @@ if [ "$DISCOVERY" == "yes" ] ; then
|
||||
fi;
|
||||
fi;
|
||||
|
||||
if [ "$DEBIAN" == "true" ] || [ "$GENTOO" == "true" ] ; then
|
||||
|
||||
echo "Do you want to start the discovered and actually started services at the next time when your system restarting? (Y/n)";
|
||||
read -r ANSWER;
|
||||
@@ -865,6 +888,8 @@ if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
||||
|
||||
$SUDO_CMD mv /tmp/$DEST_FILE /usr/local/etc/$DEST_FILE
|
||||
|
||||
|
||||
if [ "$DEBIAN" == "true" ] ; then
|
||||
{
|
||||
echo "
|
||||
[Unit]
|
||||
@@ -879,9 +904,14 @@ WantedBy=multi-user.target
|
||||
";
|
||||
|
||||
} > /tmp/discovery.service
|
||||
|
||||
$SUDO_CMD mv /tmp/discovery.service /etc/systemd/system/discovery.service
|
||||
$SUDO_CMD systemctl enable discovery.service
|
||||
|
||||
else if [ "$GENTOO" == "true" ] ; then
|
||||
$SUDO_CMD echo "/usr/local/bin/service-files.sh /usr/local/etc/results.txt restart" > /etc/local.d/service-file.start;
|
||||
$SUDO_CMD chmod a+x /etc/local.d/service-file.start;
|
||||
fi;
|
||||
fi;
|
||||
fi;
|
||||
|
||||
rm $PWD/.init_services
|
||||
|
Reference in New Issue
Block a user