File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ _mission_init() (
1818 " $GSH_TMP /test-proc-name" &
1919 PID=$!
2020 name=$( my_ps $PID | grep $PID | grep -v sh | grep " test-proc-name" )
21- # kill -9 $PID
21+ kill -9 $PID
2222 if [ -z " $name " ]
2323 then
2424 echo " $( eval_gettext " Process names should be equal to the corresponding filename for mission \$ MISSION_NAME." ) " >&2
Original file line number Diff line number Diff line change @@ -46,8 +46,12 @@ _install_script() (
4646 fi
4747 mission_source " $MISSION_DIR /deps.sh" || return 1
4848
49- cp " $MISSION_DIR /spell.sh" " $GSH_TMP /$( gettext " spell" ) "
50- chmod 755 " $GSH_TMP /$( gettext " spell" ) "
49+ # make sure the shebang for the spell.sh script is a real path to sh
50+ # otherwise, ps will not use the filename as the process name...
51+ sh=$( command -v sh)
52+ echo " #! $sh " > " $GSH_TMP /$( gettext " spell" ) "
53+ cat " $MISSION_DIR /spell.sh" >> " $GSH_TMP /$( gettext " spell" ) "
54+ chmod +x " $GSH_TMP /$( gettext " spell" ) "
5155)
5256
5357if _compile || _install_script
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
33_compile () (
4-
54 if command -v gcc > /dev/null
65 then
76 CC=gcc
@@ -59,9 +58,13 @@ _install_script() (
5958 return 1
6059 fi
6160 mission_source " $MISSION_DIR /deps.sh" || return 1
62- cp " $MISSION_DIR /spell.sh" " $GSH_TMP /$( gettext " spell" ) "
63- chmod 755 " $GSH_TMP /$( gettext " spell" ) "
64-
61+ #
62+ # make sure the shebang for the spell.sh script is a real path to sh
63+ # otherwise, ps will not use the filename as the process name...
64+ sh=$( command -v sh)
65+ echo " #! $sh " > " $GSH_TMP /$( gettext " spell" ) "
66+ cat " $MISSION_DIR /spell.sh" >> " $GSH_TMP /$( gettext " spell" ) "
67+ chmod +x " $GSH_TMP /$( gettext " spell" ) "
6568)
6669
6770if _compile || _install_script
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
33_compile () (
4-
54 if ! command -v pstree > /dev/null
65 then
76 echo " $( eval_gettext " The command 'pstree' is required for mission \$ MISSION_NAME.
@@ -81,21 +80,21 @@ _install_script() (
8180
8281 echo " #! $sh " > " $GSH_TMP /$( gettext " nice_fairy" ) "
8382 cat " $MISSION_DIR /nice_fairy.sh" >> " $GSH_TMP /$( gettext " nice_fairy" ) "
84- chmod 755 " $GSH_TMP /$( gettext " nice_fairy" ) "
83+ chmod +x " $GSH_TMP /$( gettext " nice_fairy" ) "
8584
8685 mkdir -p " $GSH_TMP /fairy/"
8786 echo " #! $sh " > " $GSH_TMP /fairy/$( gettext " spell" ) "
8887 cat " $MISSION_DIR /fairy/spell.sh" >> " $GSH_TMP /fairy/$( gettext " spell" ) "
89- chmod 755 " $GSH_TMP /fairy/$( gettext " spell" ) "
88+ chmod +x " $GSH_TMP /fairy/$( gettext " spell" ) "
9089
9190 echo " #! $sh " > " $GSH_TMP /$( gettext " mischievous_imp" ) "
9291 cat " $MISSION_DIR /mischievous_imp.sh" >> " $GSH_TMP /$( gettext " mischievous_imp" ) "
93- chmod 755 " $GSH_TMP /$( gettext " mischievous_imp" ) "
92+ chmod +x " $GSH_TMP /$( gettext " mischievous_imp" ) "
9493
9594 mkdir -p " $GSH_TMP /imp/"
9695 echo " #! $sh " > " $GSH_TMP /imp/$( gettext " spell" ) "
9796 cat " $MISSION_DIR /imp/spell.sh" >> " $GSH_TMP /imp/$( gettext " spell" ) "
98- chmod 755 " $GSH_TMP /imp/$( gettext " spell" ) "
97+ chmod +x " $GSH_TMP /imp/$( gettext " spell" ) "
9998)
10099
101100
You can’t perform that action at this time.
0 commit comments