forked from coolaj86/telebit.js
		
	continue when systemd --user fails
This commit is contained in:
		
							parent
							
								
									52d344c6e9
								
							
						
					
					
						commit
						4f0db8bc9c
					
				| @ -493,16 +493,22 @@ elif [ "systemd" == "$my_system_launcher" ]; then | |||||||
|     else |     else | ||||||
|       echo -n "." |       echo -n "." | ||||||
|     fi |     fi | ||||||
|     systemctl --user daemon-reload |     set +e | ||||||
|     # enable also puts success output to stderr... why? |     if systemctl --user daemon-reload; then | ||||||
|     systemctl --user enable $my_app >/dev/null 2>/dev/null |       # enable also puts success output to stderr... why? | ||||||
|     #echo "    > systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer" |       systemctl --user enable $my_app >/dev/null 2>/dev/null | ||||||
|     #systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer |       #echo "    > systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer" | ||||||
|     if [ -n "${TELEBIT_DEBUG}" ]; then |       #systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer | ||||||
|       echo "    > systemctl --user start $my_app" |       if [ -n "${TELEBIT_DEBUG}" ]; then | ||||||
|  |         echo "    > systemctl --user start $my_app" | ||||||
|  |       fi | ||||||
|  |       systemctl --user stop $my_app >/dev/null 2>/dev/null | ||||||
|  |       systemctl --user start $my_app >/dev/null | ||||||
|  |     else | ||||||
|  |       echo "libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher." | ||||||
|  |       echo "sudo apt-install -y libpam-systemd" | ||||||
|  |       sudo apt-install -y libpam-systemd | ||||||
|     fi |     fi | ||||||
|     systemctl --user stop $my_app >/dev/null 2>/dev/null |  | ||||||
|     systemctl --user start $my_app >/dev/null |  | ||||||
|     sleep 2; # give it time to start |     sleep 2; # give it time to start | ||||||
|     _is_running=$(systemctl --user status --no-pager $my_app 2>/dev/null | grep "active.*running") |     _is_running=$(systemctl --user status --no-pager $my_app 2>/dev/null | grep "active.*running") | ||||||
|     if [ -z "$_is_running" ]; then |     if [ -z "$_is_running" ]; then | ||||||
| @ -510,6 +516,7 @@ elif [ "systemd" == "$my_system_launcher" ]; then | |||||||
|       systemctl --user status --no-pager $my_app |       systemctl --user status --no-pager $my_app | ||||||
|       exit 1 |       exit 1 | ||||||
|     fi |     fi | ||||||
|  |     set -e | ||||||
|     echo -n "." |     echo -n "." | ||||||
|   else |   else | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user