This commit is contained in:
44
install.sh
44
install.sh
@@ -183,10 +183,11 @@ check_dirs_and_files() {
|
|||||||
|
|
||||||
check_running() {
|
check_running() {
|
||||||
|
|
||||||
# Custom gentoo docker status check
|
DOCKERD_STATUS="0";
|
||||||
DOCKERD_STATUS=$($SUDO_CMD rc-status 2>/dev/null | grep docker | grep started | wc -l);
|
|
||||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
|
||||||
|
|
||||||
|
which systemctl;
|
||||||
|
|
||||||
|
if [ "$?" == "0" ]; then
|
||||||
DOCKERD_STATUS=$($SUDO_CMD systemctl status docker | grep running | wc -l)
|
DOCKERD_STATUS=$($SUDO_CMD systemctl status docker | grep running | wc -l)
|
||||||
if [ "$DOCKERD_STATUS" == "0" ]; then
|
if [ "$DOCKERD_STATUS" == "0" ]; then
|
||||||
$SUDO_CMD systemctl start docker
|
$SUDO_CMD systemctl start docker
|
||||||
@@ -197,6 +198,27 @@ check_running() {
|
|||||||
exit;
|
exit;
|
||||||
fi
|
fi
|
||||||
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
|
fi
|
||||||
|
|
||||||
# bridge check
|
# bridge check
|
||||||
@@ -836,10 +858,11 @@ if [ "$DISCOVERY" == "yes" ] ; then
|
|||||||
fi;
|
fi;
|
||||||
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)";
|
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;
|
read -r ANSWER;
|
||||||
if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
||||||
|
|
||||||
cp $DISCOVERY_CONFIG_FILE $DISCOVERY_CONFIG_FILE".copy";
|
cp $DISCOVERY_CONFIG_FILE $DISCOVERY_CONFIG_FILE".copy";
|
||||||
cp $DEST_FILE $DEST_FILE".copy";
|
cp $DEST_FILE $DEST_FILE".copy";
|
||||||
@@ -865,6 +888,8 @@ if [ "$ANSWER" == "y" ] || [ "$ANSWER" == "Y" ] || [ "$ANSWER" == "" ] ; then
|
|||||||
|
|
||||||
$SUDO_CMD mv /tmp/$DEST_FILE /usr/local/etc/$DEST_FILE
|
$SUDO_CMD mv /tmp/$DEST_FILE /usr/local/etc/$DEST_FILE
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$DEBIAN" == "true" ] ; then
|
||||||
{
|
{
|
||||||
echo "
|
echo "
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -879,9 +904,14 @@ WantedBy=multi-user.target
|
|||||||
";
|
";
|
||||||
|
|
||||||
} > /tmp/discovery.service
|
} > /tmp/discovery.service
|
||||||
|
|
||||||
$SUDO_CMD mv /tmp/discovery.service /etc/systemd/system/discovery.service
|
$SUDO_CMD mv /tmp/discovery.service /etc/systemd/system/discovery.service
|
||||||
$SUDO_CMD systemctl enable 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;
|
fi;
|
||||||
|
|
||||||
rm $PWD/.init_services
|
rm $PWD/.init_services
|
||||||
|
Reference in New Issue
Block a user