I want to run a script at startup and shutdown by placing it in ~/.profile and ~/.bash_logout?
The script is an adaptation of
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wiki.archlinux.org/index.php/Firefox_on_RAM#The_script"
linktext was:"firefox-sync"
====================================
and the idea is from
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://wiki.archlinux.org/index.php/Firefox_on_RAM#Sync_at_login.2Flogout"
linktext was:"here"
====================================
. It works for me on a different distro with OpenRC, but there the .bash_profile and .bash_logout look much easier than in antiX. It was possible there to simply append ~/.bin/qupzilla-sync at the end of each file. On antiX this didn't have any effect. The script is running well in terminal. The code is FYI:
Code: Select all
#!/bin/sh
static=56ucrisx.default.backup
link=56ucrisx.default
volatile=/dev/shm/palemoon-$USER
IFS=
set -efu
cd ~/.moonchild\ productions/pale\ moon
if [ ! -r $volatile ]; then
mkdir -m0700 $volatile
fi
if ["$(readlink $link)" !="$volatile" ]; then
mv $link $static
ln -s $volatile $link
fi
if [ -e $link/.unpacked ]; then
rsync -av --delete --exclude .unpacked ./$link/ ./$static/
else
rsync -av ./$static/ ./$link/
touch $link/.unpacked
fi
I know there are other options like cron or with / etc/init.d/rc.local like
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://crunchbang.org/forums/viewtopic.php?id=14453"
linktext was:"here"
====================================
.
But I would prefer a solution in $HOME.