Made installer, which creates an uninstaller in the /opt/scion directory
This commit is contained in:
parent
69fc5db07d
commit
67914890f7
|
@ -31,28 +31,18 @@ from bt.file import fopen
|
||||||
|
|
||||||
# Return the value at key
|
# Return the value at key
|
||||||
def get(key, all=False):
|
def get(key, all=False):
|
||||||
|
global settings
|
||||||
if(all == False):
|
if(all == False):
|
||||||
return settings[key.upper()][0]
|
return settings[key.upper()][0]
|
||||||
else:
|
else:
|
||||||
return settings[key.upper()]
|
return settings[key.upper()]
|
||||||
|
|
||||||
|
|
||||||
#def replace(key,value):
|
def replace(key,value):
|
||||||
# global settings
|
|
||||||
# if (key in settings) == True:
|
|
||||||
# del settings[key]
|
|
||||||
# set(key,value)
|
|
||||||
|
|
||||||
|
|
||||||
def pop(key):
|
|
||||||
global settings
|
global settings
|
||||||
value = None
|
|
||||||
if (key in settings) == True:
|
if (key in settings) == True:
|
||||||
values = settings[key]
|
del settings[key]
|
||||||
if len(values) > 0:
|
set(key,value)
|
||||||
value = values.pop(0)
|
|
||||||
return value
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Read settings from file
|
# Read settings from file
|
||||||
|
|
|
@ -10,7 +10,6 @@ app = "scion"
|
||||||
type = "core"
|
type = "core"
|
||||||
path = ""
|
path = ""
|
||||||
opt = []
|
opt = []
|
||||||
|
|
||||||
import curses
|
import curses
|
||||||
from bt.message import *
|
from bt.message import *
|
||||||
#from bt.needle import Needle
|
#from bt.needle import Needle
|
||||||
|
|
|
@ -25,7 +25,7 @@ def loop():
|
||||||
write("Beginning command line loop",True)
|
write("Beginning command line loop",True)
|
||||||
global halt
|
global halt
|
||||||
|
|
||||||
#stdscr = settings.get("stdscr")
|
stdscr = settings.get("stdscr")
|
||||||
input = settings.get("prompt")
|
input = settings.get("prompt")
|
||||||
(y, x) = settings.get("stdscr").getyx()
|
(y, x) = settings.get("stdscr").getyx()
|
||||||
disp(input)
|
disp(input)
|
||||||
|
|
|
@ -12,9 +12,9 @@ import settings
|
||||||
# Add string to line y
|
# Add string to line y
|
||||||
def insert(string):
|
def insert(string):
|
||||||
stdscr = settings.get("stdscr")
|
stdscr = settings.get("stdscr")
|
||||||
y = settings.pop("cliney")
|
y = settings.get("cliney")
|
||||||
y+=1
|
y+=1
|
||||||
settings.set("cliney", y)
|
settings.replace("cliney", y)
|
||||||
stdscr.addstr(y, 0, string)
|
stdscr.addstr(y, 0, string)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,5 +21,7 @@ def run(input):
|
||||||
manager.run(input)
|
manager.run(input)
|
||||||
|
|
||||||
y = settings.get("cliney")
|
y = settings.get("cliney")
|
||||||
settings.replace("cliney", y+1)
|
y+=1
|
||||||
|
settings.replace("cliney", y)
|
||||||
|
|
||||||
return prompt
|
return prompt
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir /opt/scion
|
||||||
|
rsync -avz --progress base /opt/scion/
|
||||||
|
rsync -avz --progress core /opt/scion/
|
||||||
|
|
||||||
|
FILE="/usr/bin/scion"
|
||||||
|
touch $FILE
|
||||||
|
echo "#!/bin/bash" > $FILE
|
||||||
|
echo "cd /opt/scion/base && \`which python\` scion.py \$\*" >> $FILE
|
||||||
|
|
||||||
|
chmod +x $FILE
|
||||||
|
|
||||||
|
|
||||||
|
UNINSTALL="/opt/scion/uninstall.sh"
|
||||||
|
touch $UNINSTALL
|
||||||
|
echo "#!/bin/bash" > $UNINSTALL
|
||||||
|
echo "cd /opt/ && rm -r scion" >> $UNINSTALL
|
||||||
|
echo "rm /usr/bin/scion" >> $UNINSTALL
|
Loading…
Reference in New Issue