aboutsummaryrefslogtreecommitdiff
path: root/shell.nix
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-01-19 20:57:27 +0200
committerSyndamia <kamen@syndamia.com>2025-01-19 20:57:27 +0200
commit54c83dedd51dbf1b8bd88d0acf216d617c6b1c12 (patch)
treea85a2bf3d4483add97cfa7cfa1751c55bf784e9b /shell.nix
parentda156bc5f8735542bb5e351633b133339e8713e2 (diff)
downloadnowayforward_human-54c83dedd51dbf1b8bd88d0acf216d617c6b1c12.tar
nowayforward_human-54c83dedd51dbf1b8bd88d0acf216d617c6b1c12.tar.gz
nowayforward_human-54c83dedd51dbf1b8bd88d0acf216d617c6b1c12.zip
feat(shell.nix): Add recovery/resetting on launch
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
index 5198659..0887d56 100644
--- a/shell.nix
+++ b/shell.nix
@@ -40,6 +40,28 @@ let
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
#