#! /bin/sh set -e PMB_PASSWD_FILE="/etc/pmb/pmb_passwd" PMB_PASSWD="" create_passwd() { PMB_PASSWD="$(pwgen -s -B -1)" echo $PMB_PASSWD > $PMB_PASSWD_FILE 2>/dev/null || true chown root:root $PMB_PASSWD_FILE 2>/dev/null || true chmod 600 $PMB_PASSWD_FILE 2>/dev/null || true } if [ -f "$PMB_PASSWD_FILE" ]; then PMB_PASSWD="$(cat $PMB_PASSWD_FILE 2>/dev/null | head -1)" [ -z $PMB_PASSWD ] && create_passwd else create_passwd fi #DEBHELPER# exit 0