unifios-utilities/on-boot-script/examples/udm-files/on_boot.d/15-preserve-history.sh
2023-01-17 03:41:30 -08:00

14 lines
295 B
Bash
Executable File

#!/bin/sh
mkdir -p /mnt/data/.home
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
ln -sf /mnt/data/.home/$file /root/$file