/    Sign up×
Community /Pin to ProfileBookmark

Button to run a script file

I have a server with root access etc

I have a command script file

———stoptrans.sh————

killall -SIGKILL sc_trans_linux
———————

I need a button to run this script.

What is the command in a button to run a server command script?

That is, what would be

$> ./stoptrans.sh

if I were typing at a command prompt.

stoptrans.sh is in the same folder as the webpage or can be in any location on the server like the root.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@rootApr 14.2015 — Said before, you need a PHP script handler that the web client calls, the PHP file runs the shell script.

Alternative would be to set a cronjob to run the script automatically.

Please don't duplicate posts, if you have anything to add then add to the original thread you started or just bump the post.
Copy linkTweet thisAlerts:
@gjerichApr 14.2015 — you can execute command with exec('killall -SIGKILL sc_trans_linux'), or write shell in file php. read. than call php file button. if i recall correctly - php file should be executable and root:root (owner:group).

regards
×

Success!

Help @Applesources spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...