This commit is contained in:
Your Name
2025-05-02 22:22:52 +12:00
parent 656c6431a5
commit 844ab60834
2 changed files with 10 additions and 46 deletions

View File

@@ -1,6 +1,4 @@
#!/bin/sh
# bootstrapping with sh until we have bash installed
# can you make this script run in bash, but fall back to sh if bash is not installed?
# check if we are running as root
if [ "$(id -u)" -ne 0 ]; then
@@ -15,8 +13,11 @@ if ! command -v bash > /dev/null 2>&1; then
apt install -y bash
fi
# switch to bash as our shell
chsh -s /bin/bash
# re-exec this script in bash if not already running in bash
if [ -z "$BASH_VERSION" ]; then
echo "Re-executing script in Bash..."
exec /bin/bash "$0" "$@"
fi
if [ -n "$BASH_VERSION" ]; then
echo "Running in Bash $BASH_VERSION"
@@ -84,6 +85,9 @@ if [ ! -f "/home/dropshell/.ssh/known_hosts" ]; then
touch /home/dropshell/.ssh/known_hosts
fi
# ensure default shell for dropshell user is bash
chsh -s /bin/bash dropshell
#--------------------------------
# download dropshell