distribution/packages/sysutils/autostart/sources/common/007-rootpw
fewtarius 4b9e65325f
* Update kernel and OS to support AyaNeo Air / Air Pro fan control.
* Bump WIFI drivers.
* Add WIFI module quirk and WIFI not waking from sleep on Air.
* Fix splash screen on rotated displays.
* Move autostart to its own package.
2022-12-19 17:14:32 -05:00

22 lines
495 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
if [ ! -d "/storage/.cache/samba" ]
then
mkdir -p /storage/.cache/samba
touch /storage/.cache/samba/smbpasswd
fi
ROTATION=$(get_setting rotate.root.password)
if [ "${ROTATION}" == "0" ]
then
exit 0
fi
# Randomly generate the root password on startup
ROOTPASS=$(openssl rand -base64 10 2>/dev/null | sed "s#==##g")
/usr/bin/setrootpass "${ROOTPASS}"