fixes button
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# bt-set-master - set the deploy-time emergency master password.
|
||||
#
|
||||
# Usage (once at first install):
|
||||
# sudo /opt/buttontask/scripts/bt-set-master 'your-secret'
|
||||
#
|
||||
# Writes $BUTTONTASK_ROOT/config/.master (mode 600, buttontask-owned).
|
||||
# Used by web login and Qt settings password check as a fallback.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="${BUTTONTASK_ROOT:-/opt/buttontask}"
|
||||
FILE="$ROOT/config/.master"
|
||||
|
||||
[ "$#" -eq 1 ] || { echo "usage: bt-set-master <password>" >&2; exit 2; }
|
||||
[ -n "$1" ] || { echo "password must not be empty" >&2; exit 1; }
|
||||
|
||||
install -d -m 0750 "$ROOT/config"
|
||||
umask 077
|
||||
printf '%s' "$1" > "$FILE"
|
||||
chmod 600 "$FILE"
|
||||
chown buttontask:buttontask "$FILE" 2>/dev/null || true
|
||||
echo "master password set: $FILE"
|
||||
Reference in New Issue
Block a user