Prevent to run script which weren't "built"
This commit is contained in:
		@@ -2,7 +2,7 @@ SUBDIRS = applications icons/48x48 icons/64x64 icons/scalable
 | 
			
		||||
bin_SCRIPTS = pam_panic_config
 | 
			
		||||
 | 
			
		||||
%: %.prebuild
 | 
			
		||||
	{ sldr=$$(echo "$(SECUREDIR)" | $(SED) 's/\//\\\//g');	$(SED) "s/__SECURELIBDIR__/$$sldr/" $< > $@ ; }
 | 
			
		||||
	{ sldr=$$(echo "$(SECUREDIR)" | $(SED) 's/\//\\\//g'); bdr=$$(echo "$(bindir)" | $(SED) 's/\//\\\//g'); $(SED) "s/__SECURELIBDIR__/$$sldr/;s/__PAMPANICPW__/$$bdr\/pam_panic_pw/" $< > $@ ; }
 | 
			
		||||
 | 
			
		||||
clean-local:
 | 
			
		||||
	$(RM) *.tmp
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,9 @@ LHBU="$HOME/LUKSHeaderBackup"
 | 
			
		||||
 | 
			
		||||
# Set on build time
 | 
			
		||||
SECUREDIR="__SECURELIBDIR__"
 | 
			
		||||
PAMPANICPW="__PAMPANICPW__"
 | 
			
		||||
 | 
			
		||||
[[ ! -d $SECUREDIR ]] || [[ ! -f $PAMPANICPW ]]  && { echo "ERROR: Bash script was not build correctly." ; exit 1 ; }
 | 
			
		||||
 | 
			
		||||
if [ $EUID -ne 0 ]; then
 | 
			
		||||
  echo "Please run this script as root or using sudo."
 | 
			
		||||
@@ -174,7 +177,7 @@ while [ $auth_mode -eq 2 ]; do
 | 
			
		||||
      case $setpw in
 | 
			
		||||
          "0")
 | 
			
		||||
            clear
 | 
			
		||||
            pam_panic_pw
 | 
			
		||||
            $PAMPANICPW
 | 
			
		||||
            if [ $? -ne 0 ]; then
 | 
			
		||||
              clear
 | 
			
		||||
              echo "Failed to set a password. :("
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user