-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRun.sh
45 lines (34 loc) · 995 Bytes
/
Run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# bash script to run sh files in the terminal emulators
# Copyright (C) 2014-2015 Md Imam Hossain
# License
# This program is free software; you can use it for any purposes but can not redistribute it and/or modify it.
# This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY.
RRVal=0
CDIR="`dirname "$0"`"
if [ $CDIR == "." ]; then
CDIR="`pwd`"
fi
cd $CDIR
if [ -f /usr/bin/gnome-terminal ]
then
/usr/bin/gnome-terminal --title="SConfiguration" --working-directory="$CDIR" -e "./Setup.sh"
RRVal=$?
elif [ -f /usr/bin/konsole ]
then
/usr/bin/konsole --workdir="$CDIR" --hide-menubar --show-tabbar -e ./Setup.sh
RRVal=$?
elif [ -f /usr/bin/xterm ]
then
/usr/bin/xterm -title "SConfiguration" -e "cd \"$CDIR\" && ./Setup.sh"
RRVal=$?
else
echo "Can not start Setup, please check if the terminal application is installed" > tempm
xdg-open tempm
fi
if [ $RRVal -ne 0 ]
then
echo "Setup was unsuccessful" > tempm
xdg-open tempm
fi
exit $RRVal