## arg 1: the new package version post_install() { echo "Make sure to add your user to the games group to play dwarffortress" post_upgrade $1 0 } ## arg 1: the new package version ## arg 2: the old package version post_upgrade() { #may need to update savegames if [ ! `vercmp $2 $1` -eq 1 ]; then echo "Raws might have changed. Do you want to update your savegames? [y/N]" read -n 1 choice if [[ ("${choice}" == "y") || ("${choice}" == "Y") ]]; then for dir in $(find /opt/df_linux-sf/data/save/ -type d); do if [ -d "${dir}/raw" ]; then echo "Upgrading save ${dir}" cp -rf /opt/df_linux-sf/raw "${dir}/" fi done fi fi # Make sure that permissions are correct chown -R root:games /opt/df_linux-sf/data chown root:games /opt/df_linux-sf chmod 775 /opt/df_linux-sf find /opt/df_linux-sf/data/save -type d -exec chmod 775 {} + & find /opt/df_linux-sf/data/save -type f -exec chmod 664 {} + & } # vim:set ts=2 sw=2 et: