check that script is sourced and not run
This commit is contained in:
parent
8a0c325ee2
commit
2fb18c78f0
1 changed files with 6 additions and 1 deletions
7
snap-pac
7
snap-pac
|
|
@ -24,7 +24,12 @@
|
|||
set -e
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "snap-pac must be run as root."
|
||||
echo "snap-pac must be sourced as root."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
echo "This script is intended to be sourced from a pacman hook and not run on its own."
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue