-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsl-autostart.sh
24 lines (19 loc) · 1.58 KB
/
wsl-autostart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -------------------------------------------------------------------------------------------------------------------- #
# Copyright (c) 2017 Juri Boxberger #
# -------------------------------------------------------------------------------------------------------------------- #
# @author Juri Boxberger #
# @date 20.10.2017 #
# License: GNU GPLv3 #
# -------------------------------------------------------------------------------------------------------------------- #
# @version 1.0 #
# -------------------------------------------------------------------------------------------------------------------- #
#!/bin/sh
if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
sudo -S service apache2 start > /dev/null && echo 'Apache Started'
fi
if [ $(dpkg-query -W -f='${Status}' mysql-server 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
sudo -S service mysql start > /dev/null && echo 'Mysql Started'
fi
if [ $(dpkg-query -W -f='${Status}' openssh-server 2>/dev/null | grep -c "ok installed") -eq 1 ]; then
sudo -S service ssh --full-restart > /dev/null 2> /dev/null
fi