From 54c83dedd51dbf1b8bd88d0acf216d617c6b1c12 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 19 Jan 2025 20:57:27 +0200 Subject: feat(shell.nix): Add recovery/resetting on launch --- shell.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'shell.nix') diff --git a/shell.nix b/shell.nix index 5198659..0887d56 100644 --- a/shell.nix +++ b/shell.nix @@ -39,6 +39,28 @@ let : ''${ARCHIVES_DIR:=$REPOSITORY/.archives} export ARCHIVES_DIR + # + # Reseting + # + + pkill httpd >/dev/null 2>&1 + pkill php-fpm >/dev/null 2>&1 + pkill mysqld >/dev/null 2>&1 + + read -t 2 -p "Nuke .config and .archives? [y/N] " NUKE + NUKE="''${NUKE,,}" + if [ "$NUKE" == 'y' -o "$NUKE" == 'yes' ] + then + echo 'Removing .config and .archives...' + rm -r "$MYSQL_HOME" "$ROOT_DIR" "$ARCHIVES_DIR" + elif [ -z "$NUKE" ] + then + echo no + elif ! [ "$NUKE" == 'n' -o "$NUKE" == 'no' ] + then + printf "Unknown responce '$NUKE', not nuking!" + fi + # # Apache2 # -- cgit v1.2.3