.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user