Skip to content

Commit

Permalink
scripts/update-systemd-from-27-to-238: Do nothing if systemd 238 is r…
Browse files Browse the repository at this point in the history
…unning

As a safety measure, check if systemd 238 already runs, and abort if it
is.

```
@ryan:~> systemd --version
systemd: unrecognized option '--version'
Unknown option code ?
```

```
$ systemd --version
systemd 238
+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP
-LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS
+KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
```

```
$ scripts/update-systemd-from-27-to-238.sh
+ hostconfig mx64
+ systemd --version
+ echo 'systemd 238 is already running. Nothing to do.'
systemd 238 is already running. Nothing to do.
+ exit 0
```

From the manual page bash(1):

> { list; }
>        list is simply executed in the current shell environment.   list
>        must  be  terminated with a newline or semicolon.  This is known
>        as a group command.  The return status is  the  exit  status  of
>        list.   Note that unlike the metacharacters ( and ), { and } are
>        reserved words and must occur where a reserved word is permitted
>        to  be  recognized.   Since they do not cause a word break, they
>        must be separated from  list  by  whitespace  or  another  shell
>        metacharacter.
  • Loading branch information
pmenzel committed Mar 29, 2018
1 parent af9a760 commit 479a9f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/update-systemd-from-27-to-238.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if ! { hostconfig mx64; }; then
exit 1
fi

if { systemd --version 2>&1 1>/dev/null; }; then
echo "systemd 238 is already running. Nothing to do."
exit 0
fi

bee remove sysvinit-2.88dsf-2.x86_64 udev-164-2.x86_64
bee install -f systemd-238-0
bee update -f dbus-1.12.4-0
Expand Down

0 comments on commit 479a9f2

Please sign in to comment.