File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
+ service_exists () {
3
+ local n=$1
4
+ if [[ $( systemctl list-units --all -t service --full --no-legend " $n .service" | cut -f1 -d' ' ) == $n .service ]]; then
5
+ return 0
6
+ else
7
+ return 1
8
+ fi
9
+ }
10
+
2
11
echo Beginning cypher node install
3
12
tmp_dir=$( mktemp -d -t ci-XXXXXXXXXX)
4
13
echo " Temporary directory ${tmp_dir} created"
@@ -11,6 +20,9 @@ echo "Extracting $tmp_dir/cypher.zip"
11
20
12
21
unzip -o $tmp_dir /cypher.zip -d $tmp_dir /cypher
13
22
23
+ # Rename appsettings.json to appsettings.default.json
24
+ mv $tmp_dir /cypher/appsettings.json $tmp_dir /cypher/appsettings.default.json
25
+
14
26
if [ ! -d $HOME /.cypher ]
15
27
then
16
28
echo " Creating $HOME /.cypher"
@@ -39,6 +51,25 @@ echo "Cleaning up temporary directory ${tmp_dir}"
39
51
40
52
rm -rf $tmp_dir
41
53
54
+ if [ -d " /run/systemd/system/" ]
55
+ then
56
+ if ! service_exists cypnode; then
57
+ echo " cypnode.service not detected"
58
+
59
+ while true ; do
60
+ read -p " Would you like to install cynode as a service?" yn
61
+ case $yn in
62
+ [Yy]* ) curl -s https://raw.githubusercontent.com/cypher-network/cypher/$version /create-service.sh | bash; break ;;
63
+ [Nn]* ) break ;;
64
+ * ) echo " Please answer yes or no." ;;
65
+ esac
66
+ done
67
+ else
68
+ echo " cynode.service already installed, restarting..."
69
+ systemctl restart cypnode.service
70
+ fi
71
+ fi
72
+
42
73
if grep -q " $HOME /.cypher/bin" ~ /.profile
43
74
then
44
75
:
You can’t perform that action at this time.
0 commit comments