[why] my-qemu.sh can't exit after job done, because archlinux don't use 'reboot' command to reboot, it use 'systemctl reboot' to reboot
[how] judge os, use 'systemctl reboot' command when ${os} is archlinux
Signed-off-by: Wang Yong wangyong0117@qq.com --- lib/reboot.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lib/reboot.sh b/lib/reboot.sh index 8557c5972..5551dc586 100644 --- a/lib/reboot.sh +++ b/lib/reboot.sh @@ -2,5 +2,9 @@
reboot_tbox() { + [ ${os} == "archlinux" ] && { + systemctl reboot + } + reboot }
On Tue, Nov 17, 2020 at 06:32:12PM +0800, Wang Yong wrote:
[why] my-qemu.sh can't exit after job done, because archlinux don't use 'reboot' command to reboot, it use 'systemctl reboot' to reboot
[how] judge os, use 'systemctl reboot' command when ${os} is archlinux
Signed-off-by: Wang Yong wangyong0117@qq.com
lib/reboot.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lib/reboot.sh b/lib/reboot.sh index 8557c5972..5551dc586 100644 --- a/lib/reboot.sh +++ b/lib/reboot.sh @@ -2,5 +2,9 @@
reboot_tbox() {
- [ ${os} == "archlinux" ] && {
systemctl reboot
- }
- reboot
如果是archlinux systemctl reboot 和 reboot 都会被执行到 这是你想要的吗?虽然系统重启了可能没什么影响,但是我认为还是用 if [ ${os} == "archlinux" ]; then systemctl reboot elae reboot fi
}
2.23.0
On Tue, Nov 17, 2020 at 06:41:26PM +0800, Sun Yukui wrote:
On Tue, Nov 17, 2020 at 06:32:12PM +0800, Wang Yong wrote:
[why] my-qemu.sh can't exit after job done, because archlinux don't use 'reboot' command to reboot, it use 'systemctl reboot' to reboot
[how] judge os, use 'systemctl reboot' command when ${os} is archlinux
Signed-off-by: Wang Yong wangyong0117@qq.com
lib/reboot.sh | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lib/reboot.sh b/lib/reboot.sh index 8557c5972..5551dc586 100644 --- a/lib/reboot.sh +++ b/lib/reboot.sh @@ -2,5 +2,9 @@
reboot_tbox() {
- [ ${os} == "archlinux" ] && {
systemctl reboot
- }
- reboot
如果是archlinux systemctl reboot 和 reboot 都会被执行到 这是你想要的吗?虽然系统重启了可能没什么影响,但是我认为还是用 if [ ${os} == "archlinux" ]; then systemctl reboot elae reboot fi
ok
Thanks, Wang Yong