-
Notifications
You must be signed in to change notification settings - Fork 5
/
App
executable file
·47 lines (43 loc) · 1.21 KB
/
App
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
46
47
#!/bin/bash
# Copyright 2020 Liam Breck
# Published at https://github.com/networkimprov/mnm-hammer
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/
set -e
echo "Welcome to mnm!"
cd "$(dirname "$0")"
if [ ! -e 'store' ]; then
found=$(ls -dt ../mnm-*-v0.*.?/store | head -1)
if [ "$found" ]; then
echo "It looks like you're updating from $(dirname $found)."
echo "Press U to update, N to start anew, or Q to quit."
key=0
while true; do
echo -n "u/n/q: "
read -rn1 key
echo
case "$key" in [UuNnQq]) break;; esac
done
if [ "$key" = 'q' -o "$key" = 'Q' ]; then exit 0; fi
if [ "$key" = 'u' -o "$key" = 'U' ]; then
echo "Moving $found"
mv "$found" ./
fi
echo
fi
fi
while true; do
./mnm-hammer -http :8123 || true
echo $'\n'"Press R to restart, or Q to quit."
key=0
while true; do
echo -n "r/q: "
read -rn1 key
echo
case "$key" in [RrQq]) break;; esac
done
if [ "$key" = 'q' -o "$key" = 'Q' ]; then exit 0; fi
echo
done