From b0b1edc61c55dee9b5a3394bfe6045fcaea4690b Mon Sep 17 00:00:00 2001 From: Dimitry Ishenko Date: Fri, 13 Dec 2024 22:20:27 -0500 Subject: [PATCH] Automated conversion --- tools/json/config.software.json | 14 +++++++------- tools/json/config.system.json | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/json/config.software.json b/tools/json/config.software.json index a28cb4e7..8697455d 100644 --- a/tools/json/config.software.json +++ b/tools/json/config.software.json @@ -253,7 +253,7 @@ ], "status": "Stable", "author": "@igorpecovnik", - "condition": "systemctl is-active --quiet service display-manager" + "condition": "srv_active display-manager" } ] }, @@ -348,7 +348,7 @@ "command": [ "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", "check_if_installed avahi-daemon", - "systemctl stop avahi-daemon avahi-daemon.socket", + "srv_stop avahi-daemon avahi-daemon.socket", "debconf-apt-progress -- apt-get -y purge avahi-daemon" ], "status": "Stable", @@ -1161,22 +1161,22 @@ "id": "MAN003", "description": "Start Cockpit Service", "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " + "srv_enable --now cockpit.socket | show_infobox " ], "status": "Stable", "author": "@schwar3kat", - "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + "condition": "check_if_installed cockpit && ! srv_enabled cockpit.socket > /dev/null 2>&1" }, { "id": "MAN004", "description": "Stop Cockpit Service", "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " + "srv_stop cockpit cockpit.socket", + "srv_disable cockpit.socket | show_infobox " ], "status": "Stable", "author": "@schwar3kat", - "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + "condition": "check_if_installed cockpit && srv_enabled cockpit.socket > /dev/null 2>&1" }, { "id": "MAN005", diff --git a/tools/json/config.system.json b/tools/json/config.system.json index 6be7d453..9da3fbf4 100644 --- a/tools/json/config.system.json +++ b/tools/json/config.system.json @@ -169,7 +169,7 @@ "description": "Disable root login", "command": [ "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -180,7 +180,7 @@ "description": "Enable root login", "command": [ "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -191,7 +191,7 @@ "description": "Disable password login", "command": [ "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -202,7 +202,7 @@ "description": "Enable password login", "command": [ "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -213,7 +213,7 @@ "description": "Disable Public key authentication login", "command": [ "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -224,7 +224,7 @@ "description": "Enable Public key authentication login", "command": [ "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -238,7 +238,7 @@ "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -253,7 +253,7 @@ "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", "[ ! -f /root/.google_authenticator ] && qr_code generate", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "srv_restart sshd.service 2>/dev/null | srv_restart ssh.service 2>/dev/null" ], "status": "Stable", "author": "@igorpecovnik", @@ -284,7 +284,7 @@ "description": "Disable last login banner", "command": [ "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " + "srv_restart ssh.service " ], "status": "Stable", "author": "@igorpecovnik", @@ -295,7 +295,7 @@ "description": "Enable last login banner", "command": [ "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " + "srv_restart ssh.service " ], "status": "Stable", "author": "@igorpecovnik",