Commit da4d332f authored by tomogoma's avatar tomogoma

Reorganize - logic; put common commands together

parent 4acae95a
...@@ -21,7 +21,7 @@ function setInstallDirs { ...@@ -21,7 +21,7 @@ function setInstallDirs {
extension="${filename##*.}" extension="${filename##*.}"
filename="${filename%.*}" filename="${filename%.*}"
mv -f "$filename/cockroach" "$APP_DIR/cockroach" || exit 1 mv -f "$filename/cockroach" "$APP_DIR/cockroach" || exit 1
rm -r "$filename" rm -rf "$filename"
mkdir -p "$DATA_DIR" || exit 1 mkdir -p "$DATA_DIR" || exit 1
} }
......
...@@ -8,13 +8,14 @@ DATA_DIR="/var/data/cockroachdb/" ...@@ -8,13 +8,14 @@ DATA_DIR="/var/data/cockroachdb/"
echo "Uninstalling..." echo "Uninstalling..."
if [ -f "$APP_FILE" ]; then if [ -f "$SYSTEMD_FILE" ]; then
systemctl stop cockroach.service >/dev/null systemctl stop cockroach.service >/dev/null
rm -rf "$APP_FILE" rm -f "$SYSTEMD_FILE"
systemctl daemon-reload
fi fi
if [ -f "$SYSTEMD_FILE" ]; then if [ -f "$APP_FILE" ]; then
rm -f "$SYSTEMD_FILE" rm -f "$APP_FILE"
fi fi
if [ -d "$ETCD_DIR" ]; then if [ -d "$ETCD_DIR" ]; then
...@@ -26,6 +27,4 @@ fi ...@@ -26,6 +27,4 @@ fi
echo "Data at $DATA_DIR not removed, run 'rm $DATA_DIR' if you wish to delete" echo "Data at $DATA_DIR not removed, run 'rm $DATA_DIR' if you wish to delete"
echo "Done!" echo "Done!"
`systemctl daemon-reload`
exit 0 exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment