Skip to content

Commit

Permalink
bug fixes: only master restarts/shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthMudgil committed Aug 25, 2023
1 parent 54d3b16 commit e0ad411
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ class LiquidGalaxyManager(
return if (screens == 1) 1 else (screens / 2) + 2
}

private val rightScreen: Int
get() {
return if (screens == 1) 1 else (screens / 2) + 1
}

val connected: Boolean
get() {
return session?.isConnected ?: false
Expand Down Expand Up @@ -187,7 +182,7 @@ class LiquidGalaxyManager(
}

suspend fun relaunch() {
for (i in screens downTo 1) {
for (i in 1..screens) {
val command = """/home/$username/bin/lg-relaunch > /home/$username/log.txt;
RELAUNCH_CMD="if [ -f /etc/init/lxdm.conf ]; then
export SERVICE=lxdm
Expand All @@ -208,13 +203,13 @@ class LiquidGalaxyManager(
}

suspend fun restart() {
for (i in screens downTo 1) {
for (i in 1..screens) {
execute("""sshpass -p $password ssh -t lg$i "echo $password | sudo -S reboot"""")
}
}

suspend fun shutdown() {
for (i in screens downTo 1) {
for (i in 1..screens) {
execute("""sshpass -p $password ssh -t lg$i "echo $password | sudo -S poweroff"""")
}
}
Expand Down

0 comments on commit e0ad411

Please sign in to comment.