forked from finn/tinyboard
fix root check to use if block instead of fragile && chain
This commit is contained in:
@@ -4,7 +4,10 @@ set -euo pipefail
|
||||
RCLONE_CONF="${HOME}/.config/rclone/rclone.conf"
|
||||
SSH_DIR="${HOME}/.ssh"
|
||||
|
||||
[ "$(id -u)" -eq 0 ] && echo -e "\033[0;31m[WARNING]\033[0m Running as root — keys will be written to /root/.ssh. Run as armbian instead." && exit 1 || true
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
echo -e "\033[0;31m[WARNING]\033[0m Running as root — keys will be written to /root/.ssh. Run as armbian instead."
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p "$SSH_DIR"
|
||||
touch "$SSH_DIR/known_hosts"
|
||||
chmod 700 "$SSH_DIR"
|
||||
|
||||
Reference in New Issue
Block a user