OSDN Git Service

[fix] : Fixed service check
authorhayao <shun819.mail@gmail.com>
Wed, 16 Dec 2020 09:30:05 +0000 (18:30 +0900)
committerhayao <shun819.mail@gmail.com>
Wed, 16 Dec 2020 09:30:05 +0000 (18:30 +0900)
channels/share/airootfs.any/root/customize_airootfs.sh

index 7303240..7663653 100755 (executable)
@@ -290,7 +290,8 @@ _systemd_service(){
     local _command="${1}"
     shift 1
     for _service in "${@}"; do
-        if [[ -f "$(systemctl cat "${_service}" 2> "/dev/null" | head -n 1 | tail | sed 's|# ||g')" ]]; then
+        #if [[ -f "$(systemctl cat "${_service}" 2> "/dev/null" | head -n 1 | tail | sed 's|# ||g')" ]]; then
+        if systemctl cat "${_service}" 1>&2 2>/dev/null; then
             systemctl ${_command} "${_service}"
         fi
     done