From 385ac0f68b1617551496253ea61f36ce583fc6e5 Mon Sep 17 00:00:00 2001 From: sup39 Date: Sat, 18 Jun 2022 02:22:10 +0900 Subject: [PATCH] add auto edit in setup.sh, add enable.sh --- enable.sh | 3 +++ setup.sh | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 enable.sh diff --git a/enable.sh b/enable.sh new file mode 100644 index 0000000..b605138 --- /dev/null +++ b/enable.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sudo systemctl enable certrenew.service certrenew.timer certrenew.path +sudo systemctl start certrenew.service certrenew.timer certrenew.target certrenew.path diff --git a/setup.sh b/setup.sh index 2f8941e..55c6dc1 100644 --- a/setup.sh +++ b/setup.sh @@ -14,3 +14,10 @@ Next step: (2) $ sudo systemctl enable certrenew.service certrenew.timer certrenew.path (3) $ sudo systemctl start certrenew.service certrenew.timer certrenew.target certrenew.path EOF + +if [ -z "$EDITOR" ]; then + for EDITOR in vim vi nano ""; do + if command -v "$EDITOR" &>/dev/null; then break; fi + done +fi +[ -z "$EDITOR" ] || "$EDITOR" "$dst/certrenew.service"