unifios-utilities/on-boot-script/examples/udm-files/on_boot.d/15-preserve-history.sh

14 lines
295 B
Bash
Raw Normal View History

#!/bin/sh
mkdir -p /mnt/data/.home
2023-01-17 11:41:30 +00:00
for file in .ash_history .bash_history
if [ ! -f /mnt/data/.home/$file ]; then
touch /root/$file
cp /root/$file /mnt/data/.home/$file
chown root:root /mnt/data/.home/$file
chmod 0600 /mnt/data/.home/$file
fi
2023-01-17 11:41:30 +00:00
ln -sf /mnt/data/.home/$file /root/$file