first commit
This commit is contained in:
31
external/packages/bsp/common/etc/profile.d/orangepi-activate-profile-sync-daemon.sh
vendored
Normal file
31
external/packages/bsp/common/etc/profile.d/orangepi-activate-profile-sync-daemon.sh
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||
#
|
||||
# This file is licensed under the terms of the GNU General Public
|
||||
# License version 2. This program is licensed "as is" without any
|
||||
# warranty of any kind, whether express or implied.
|
||||
|
||||
# acticate profile sync daemon
|
||||
|
||||
if [ -f "${HOME}/.activate_psd" ]; then
|
||||
rm -f ${HOME}/.activate_psd
|
||||
/usr/bin/psd >/dev/null 2>&1
|
||||
config_file="${HOME}/.config/psd/psd.conf"
|
||||
if [ -f "${config_file}" ]; then
|
||||
# test for overlayfs
|
||||
# TODO: don't enable on btrfs
|
||||
sed -i 's/#USE_OVERLAYFS=.*/USE_OVERLAYFS="yes"/' "${config_file}"
|
||||
case $(/usr/bin/psd p 2>/dev/null | grep Overlayfs) in
|
||||
*active*)
|
||||
echo -e "\nConfigured profile sync daemon with overlayfs."
|
||||
;;
|
||||
*)
|
||||
echo -e "\nConfigured profile sync daemon."
|
||||
sed -i 's/USE_OVERLAYFS="yes"/#USE_OVERLAYFS="no"/' "${config_file}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
systemctl --user enable psd.service >/dev/null 2>&1
|
||||
systemctl --user start psd.service >/dev/null 2>&1
|
||||
fi
|
||||
24
external/packages/bsp/common/etc/profile.d/orangepi-check-first-login-reboot.sh
vendored
Normal file
24
external/packages/bsp/common/etc/profile.d/orangepi-check-first-login-reboot.sh
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||
#
|
||||
# This file is licensed under the terms of the GNU General Public
|
||||
# License version 2. This program is licensed "as is" without any
|
||||
# warranty of any kind, whether express or implied.
|
||||
|
||||
# only do this for interactive shells
|
||||
if [ "$-" != "${-#*i}" ]; then
|
||||
OutstandingPackages="$(egrep -v "linux-base|linux-image" /var/run/reboot-required.pkgs 2>/dev/null)"
|
||||
if [ -f "/var/run/.reboot_required" ]; then
|
||||
printf "\n[\e[0;91m Kernel was updated, please reboot\x1B[0m ]\n\n"
|
||||
elif [ "X${OutstandingPackages}" != "X" ]; then
|
||||
# No kernel update involved, just regular packages like e.g. dbus require a reboot
|
||||
Packages="$(egrep -v "linux-base|linux-image" /var/run/reboot-required.pkgs | sort | uniq | tr '\n' ',' | sed -e 's/,/, /g' -e 's/,\ $//')"
|
||||
OlderThanOneDay=$(find /var/run/reboot-required -mtime +1)
|
||||
if [ "X${OlderThanOneDay}" = "X" ]; then
|
||||
printf "\n[\e[0;92m some packages require a reboot (${Packages})\x1B[0m ]\n\n"
|
||||
else
|
||||
printf "\n[\e[0;91m some packages require a reboot since more than 1 day (${Packages})\x1B[0m ]\n\n"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
12
external/packages/bsp/common/etc/profile.d/orangepi-check-first-login.sh
vendored
Normal file
12
external/packages/bsp/common/etc/profile.d/orangepi-check-first-login.sh
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||
#
|
||||
# This file is licensed under the terms of the GNU General Public
|
||||
# License version 2. This program is licensed "as is" without any
|
||||
# warranty of any kind, whether express or implied.
|
||||
|
||||
# First login as root?
|
||||
if [ -w /root/ -a -f /root/.not_logged_in_yet ]; then
|
||||
bash /usr/lib/orangepi/orangepi-firstlogin
|
||||
fi
|
||||
4
external/packages/bsp/common/etc/profile.d/orangepi-lang.sh
vendored
Normal file
4
external/packages/bsp/common/etc/profile.d/orangepi-lang.sh
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# This should fix
|
||||
# perl: warning: Setting locale failed.
|
||||
|
||||
export LC_ALL=$LANG
|
||||
14
external/packages/bsp/common/etc/profile.d/orangepi-ssh-title.sh
vendored
Normal file
14
external/packages/bsp/common/etc/profile.d/orangepi-ssh-title.sh
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) Authors: https://www.armbian.com/authors
|
||||
#
|
||||
# This file is licensed under the terms of the GNU General Public
|
||||
# License version 2. This program is licensed "as is" without any
|
||||
# warranty of any kind, whether express or implied.
|
||||
|
||||
if [ -n "$PS1" ] && ( [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] ); then
|
||||
tput tsl > /dev/null
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo `tput tsl` `whoami`@`hostname` `tput fsl`
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user