the way that I would do it is just to provide the script with an argument, or not, to tell the script how to proceed. using this, you would launch the script at boot one way, and at login another. here are some examples:
using an argument one method and none another:
Code:
if [ -n "$1" ]; then
we_are_booting
else
we_are_not
fi
with this, you would call the script at bootup with an argument:
and at login without
using one argument for one method and a different argument for another:
Code:
if [ "$1" = "boot" ]; then
we_are_booting
elif [ "$1" = "login" ]; then
we_are_logging_in
fi
with this, you would call the script at bootup with the 'boot' argument
Code:
/path/to/script boot
and at login with the 'login' argument
Code:
/path/to/script login
you could of course, use the number of users, or anything else to determine what to do, but this is how I would do it, to make it simple (KISS)
Bookmarks