Commit da4d332f authored by tomogoma's avatar tomogoma

Reorganize - logic; put common commands together

parent 4acae95a
......@@ -21,7 +21,7 @@ function setInstallDirs {
extension="${filename##*.}"
filename="${filename%.*}"
mv -f "$filename/cockroach" "$APP_DIR/cockroach" || exit 1
rm -r "$filename"
rm -rf "$filename"
mkdir -p "$DATA_DIR" || exit 1
}
......
......@@ -8,13 +8,14 @@ DATA_DIR="/var/data/cockroachdb/"
echo "Uninstalling..."
if [ -f "$APP_FILE" ]; then
if [ -f "$SYSTEMD_FILE" ]; then
systemctl stop cockroach.service >/dev/null
rm -rf "$APP_FILE"
rm -f "$SYSTEMD_FILE"
systemctl daemon-reload
fi
if [ -f "$SYSTEMD_FILE" ]; then
rm -f "$SYSTEMD_FILE"
if [ -f "$APP_FILE" ]; then
rm -f "$APP_FILE"
fi
if [ -d "$ETCD_DIR" ]; then
......@@ -26,6 +27,4 @@ fi
echo "Data at $DATA_DIR not removed, run 'rm $DATA_DIR' if you wish to delete"
echo "Done!"
`systemctl daemon-reload`
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