hbbs

[archived] bbs.hlirc.net
git clone https://hhvn.uk/hbbs
git clone git://hhvn.uk/hbbs
Log | Files | Refs | README | LICENSE

hooks.sh (299B)


      1 #!/bin/sh
      2 
      3 run_hooks(){
      4 	hooks=$(eval "echo \$hook_trigger_$1")
      5 	for h in $hooks
      6 	do
      7 		[ -f $cwd/hooks/$h    ] && script=$cwd/hooks/$h 
      8 		[ -f $cwd/hooks/$h.sh ] && script=$cwd/hooks/$h.sh 
      9 		[ -z "$script" ] && {
     10 			echo "no script found for hook: $h" >&2
     11 			continue
     12 		}
     13 		
     14 		sh "$script"
     15 	done
     16 }